Angular 2 RC1 Router doesn't work without any routerLInk

匿名 (未验证) 提交于 2019-12-03 01:58:03

问题:

i have serious problem with angular 2 (RC1) router.

This code works:

 

This doesn't:

//   

...so it looks like angular router needs atleast one routerLink in html template.. thats pretty strange..

回答1:

This is currently a bug present in the Angular 2 RC Router https://github.com/angular/angular/issues/8409.

As mentioned in the GitHub issue, to get around it you can either inject the router into AppComponent or just put an empty router link () into your template.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!