Open ayaanraj opened 4 years ago
In the response from your api/home
, you have
<template>
<require from="child-router/child-router"></require>
<child-router></child-router>
</template>
<child-router/>
is loaded too late, because of if.bind="viewTemplate"
I think, can you try remove that if?
Hi @bigopon
I have removed the if.bind="viewTemplate
and tried it, but still configureRouter
has not got triggered.
Hi @bigopon any update on this issue.
@ayaanraj I'm not sure if the usage you have there is supported, as normally, router view should be ready upfront.
cc @jwx @davismj @fkleuver
router-view
is registered during compilation and so any kind of dynamic (via compose, etc) or conditional (with if.bind, etc) rendering of the router-view
will lead to the registration happening too late. It must be statically present in the html template of the component you need configureRouter
to be called on.
This is a design limitation in v1 and it will not be solved in v1, however it will work just fine in v2.
Hi all,
aurelia-framework - 1.3.0, aurelia-router - 1.7.1
home.js
home.html
response from api/home
child-router/child-router.html
child-router/child-router.js
As you can see above, I'm getting the template from the server and rendering it using InlineViewStrategy and in the server response, I have required a component(child-router) and using it.
Inside the required component(child-router), I have routes defined in it, I have absorbed that all the life cycle events are triggered, but the configureRouter method is not triggered, am I doing, anything wrong here.
please help me out.