Angular 2 Routing run in new tab

前端 未结 5 1502
时光取名叫无心
时光取名叫无心 2020-11-29 06:49

I am working with a asp.net core application with angular2 and my routing is working fine.



        
5条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 07:38

    This seems a little confused.

    Opening your application in another window or tab will require your entire application to be re-bootstrapped, and then for your router to... pick up that url, convert it into a route, and load the appropriate component.

    This is exactly what will happen if you just use a link instead. In fact, that's all that's happening.

    The point of the router is to swap components in and out of your router-outlet, which is something that's been bootstrapped and exists within the confines of your running application and isn't shared across multiple windows.

提交回复
热议问题