refactor(router): rename "as" to "name" in RouteConfig

BREAKING CHANGE:

This is a rename to make routing concepts easier to understand.

Before:

```
@RouteConfig([
  { path: '/', component: MyCmp, as: 'Home' }
])
```

After:

```
@RouteConfig([
  { path: '/', component: MyCmp, name: 'Home' }
])
```

Closes #4622

Closes #4896
This commit is contained in:
Vamsi V
2015-10-25 15:00:27 +05:30
committed by Brian Ford
parent cc37d0a7fa
commit 7d83959be5
18 changed files with 158 additions and 110 deletions
@@ -43,8 +43,8 @@ class HomeCmp {
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: '/user-settings/:id', component: ControlPanelCmp, as: 'ControlPanelCmp'},
{path: '/', component: HomeCmp, as: 'HomeCmp'}
{path: '/user-settings/:id', component: ControlPanelCmp, name: 'ControlPanelCmp'},
{path: '/', component: HomeCmp, name: 'HomeCmp'}
])
class AppCmp {
}
@@ -53,8 +53,8 @@ class NoteIndexCmp {
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: '/note/:id', component: NoteCmp, as: 'NoteCmp'},
{path: '/', component: NoteIndexCmp, as: 'NoteIndexCmp'}
{path: '/note/:id', component: NoteCmp, name: 'NoteCmp'},
{path: '/', component: NoteIndexCmp, name: 'NoteIndexCmp'}
])
class AppCmp {
}
@@ -33,8 +33,8 @@ class MyCmp implements OnActivate {
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: '/', component: MyCmp, as: 'HomeCmp'},
{path: '/:param', component: MyCmp, as: 'ParamCmp'}
{path: '/', component: MyCmp, name: 'HomeCmp'},
{path: '/:param', component: MyCmp, name: 'ParamCmp'}
])
class AppCmp {
}
@@ -46,8 +46,8 @@ class MyCmp implements OnDeactivate {
directives: [ROUTER_DIRECTIVES, NgFor]
})
@RouteConfig([
{path: '/', component: MyCmp, as: 'HomeCmp'},
{path: '/:param', component: MyCmp, as: 'ParamCmp'}
{path: '/', component: MyCmp, name: 'HomeCmp'},
{path: '/:param', component: MyCmp, name: 'ParamCmp'}
])
class AppCmp {
constructor(public logService: LogService) {}
@@ -44,8 +44,8 @@ class MyCmp implements CanReuse,
directives: [ROUTER_DIRECTIVES]
})
@RouteConfig([
{path: '/', component: MyCmp, as: 'HomeCmp'},
{path: '/:name', component: MyCmp, as: 'HomeCmp'}
{path: '/', component: MyCmp, name: 'HomeCmp'},
{path: '/:name', component: MyCmp, name: 'HomeCmp'}
])
class AppCmp {
}