@ angular/router 3.0.0-alpha.3:如何迁移OnActivate

@ angular/router 3.0.0-alpha.3:如何迁移OnActivate

问题描述:

我刚刚将@ angular/router升级到3.0.0-alpha.3.但是,我找不到在2.0.0-rc.1中可用的接口OnActivate.任何提示表示赞赏.

I just upgraded @angular/router to 3.0.0-alpha.3. However, I cannot find the interface OnActivate which was available in 2.0.0-rc.1. Any hint is appreciated.

我个人并不认为CanActivate和Deactivate防护是迁移OnActivation逻辑(不是某种防护)的最佳位置.

I'm personally not convinced that CanActivate and Deactivate guards are the best places to migrate OnActivation logic that isn't a guard of some sort.

也许新的路由器事件是一个更好的选择:

Maybe the new router events are a better option: How to use NavigationStart