Main component and Class of Routing in Angular 2.
router-link – router-link directive is use to declare link into view . Its can contains optional parameters also.
Example :
<a [router-link]="['/AboutUs']">About Us</a>
router-outlet – Its work as a placeholder for views to render then component. Means template and templateUrl will be render on that location where you will use router-outlet directive.
Example :
<router-outlet></router-outlet>
@RouteConfig – We map URLs to components in this section which used inside the .
Example :
@RouteConfig([
{path: '/', component: HomeComponent, as: 'Home'},
{path: '/aboutus', component: AboutUsComponent, as: 'AboutUs' }
{path: '/contactus', component: ContactUsComponent, as: 'ContactUs' }
])
RouteParams – Parameter to a component which rendered by the router.
Read this article for more http://www.codeandyou.com/2015/11/understand-routing-in-angular-2.html
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…