问题
I've updated from "beta.17" to "2.0.0-rc.1" and I don't understand when I should use router and when router-deprecated?
回答1:
UPDATE TO ANGULAR2 RC
There are alot of changes has been made in routing in angular2 after RC some of them points i am going to mention here may help someone :-
angular2/routerhas been changed with@angular/router(also you can use old functionality of routing using import of@angular/router-deprecatedbut as of now we have to use@angular/router).@RouteConfighas been changed with@Routes.
for example :-
@Routes([
{path: '/crisis-center', component: CrisisListComponent},
{path: '/heroes', component: HeroListComponent}
])
Rest ill update soon my answer as per update in changelog. Thanks to @Benedikt for comment Article for new @Route update to angular2 RC
来源:https://stackoverflow.com/questions/37294497/difference-between-router-and-router-deprecated-in-angular2