add brandon suggestions

This commit is contained in:
Jesús Rodríguez 2016-08-09 03:30:25 +02:00
parent f08257ff4a
commit b2b47177cd
1 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@ Routing and navigation
@cheatsheetItem @cheatsheetItem
syntax(ts): syntax(ts):
`let routes: Routes = [ `const routes: Routes = [
{ path: '', HomeComponent }, { path: '', HomeComponent },
{ path: 'path/:routeParam', component: MyComponent }, { path: 'path/:routeParam', component: MyComponent },
{ path: 'staticPath', component: ... }, { path: 'staticPath', component: ... },
@ -18,7 +18,7 @@ syntax(ts):
{ path: ..., component: ..., data: { message: 'Custom' } } { path: ..., component: ..., data: { message: 'Custom' } }
]); ]);
provideRouter(routes);`|`Routes` const routing = RouterModule.forRoot(routes);`|`Routes`
syntax(js): syntax(js):
`var routes = [ `var routes = [
{ path: '', HomeComponent }, { path: '', HomeComponent },
@ -29,7 +29,7 @@ syntax(js):
{ path: ..., component: ..., data: { message: 'Custom' } } { path: ..., component: ..., data: { message: 'Custom' } }
]); ]);
ng.router.provideRouter(routes)`|`ng.router.Routes` var routing = ng.router.RouterModule.forRoot(routes);`|`ng.router.Routes`
syntax(dart): syntax(dart):
`@RouteConfig(const [ `@RouteConfig(const [
const Route(path: 'path', component: MyComponent, name: 'MyCmp' ), const Route(path: 'path', component: MyComponent, name: 'MyCmp' ),
@ -48,6 +48,7 @@ Marks the location to load the component of the active route.
@cheatsheetItem @cheatsheetItem
syntax(ts js): syntax(ts js):
` `
<a routerLink="/path">
<a [routerLink]="[ '/path', routeParam ]"> <a [routerLink]="[ '/path', routeParam ]">
<a [routerLink]="[ '/path', { matrixParam: 'value' } ]"> <a [routerLink]="[ '/path', { matrixParam: 'value' } ]">
<a [routerLink]="[ '/path' ]" [queryParams]="{ page: 1 }"> <a [routerLink]="[ '/path' ]" [queryParams]="{ page: 1 }">