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?
What is the difference between [routerLink] and routerLink ? How should you use each one? They're the same directive. You use the first one to pass a dynamic value, and the second one to pass a static path as a string.
Angular Routinglink As users perform application tasks, they need to move between the different views that you have defined. To handle the navigation from one view to the next, you use the Angular Router . The Router enables navigation by interpreting a browser URL as an instruction to change the view.
Adds directives and providers for in-app navigation among views defined in an application. Use the Angular Router service to declaratively specify application states and manage state transitions.
Routing in Angular allows the users to create a single-page application with multiple views and allows navigation between them.
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/router
has been changed with @angular/router
(also you can use old functionality of routing using import of @angular/router-deprecated
but as of now we have to use @angular/router
).
@RouteConfig
has 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With