I have found problem, need bind(this) as my arrow function need access 
this.routers, without bind(this), "this" means global.!


On Friday, February 19, 2016 at 2:48:43 PM UTC+11, Long Field wrote:
>
> My "Load async routers dynamically" have issue, but it looks like nothing 
> to do with ng2 router load, 
>
> Basically say: if routerlink component name as static string, it's all 
> fine, but I need to load routerlink component name from backend then it 
> won't work.  i.e. if routerlink component name store in a string variable, 
> it won't work.
>
> It will always show up the last routerlink component in whichever 
> routerlink clicked.
>
> Is this a concurrency issue? Can you see what is problem?
>
> Here is working version with router screen name as static string, page1~3 
> will show up when link clicked.
> http://plnkr.co/edit/y31K7xbiQSVH59qsAOZF?p=preview
>
> But inside app/MyRouterOutlet.ts, if you use "Page name as string 
>  variable start" codes it will load only the last router page only, 
> whatever links clicked
>
> here is source code: https://github.com/Longfld/DynamicalAsyncRouter
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to