-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi guys
Faced an issue with adding sub routes via RequireJS.
So idea is start with default route and add sub routes by lazy load:
On init i have:
Router
.config({
keys: true,
mode: 'hash',
rerouting: true,
root: 'Mn.UI/index.html'
})
.add(':sub', function (param, complete) {
require(['ui/sub/' + param.sub], function() {
complete(true);
})
}, { async: 1 });
Router.listen();And sub looks like
define(function(){
Router
.add('home', function() {
console.log('we are in nested route - home')
})
});When i navigate to "#home" sub route successfully adding to _routes but its callback doesn't fires.
I've expected async route complete to finish navigation after sub route has been added.
I'm i doing something wrong, or async routes doesn't fit such task?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels