Angular2 - Class - AsyncRoute

AsyncRoute is a type of RouteDefinition used to route a path to an asynchronously loaded component.

import {RouteConfig} from 'angular2/router';
@RouteConfig([
{path: '/home', loader: () => Promise.resolve(MyLoadedCmp), name: 'MyLoadedCmp'}
])
class MyApp {}

重点参数
loader: Function

异步— 大概猜测用处在于子路由的切换过程中,不block整个UI
主路由切换的话,如果除了要outlet的组件外还有其他工作要处理和渲染,也应该用这个


export class AuxRoute

AuxRoute is a type of RouteDefinition used to define an auxiliary route.

辅助性路由

<a [routerLink]="['ParentApp',['Alert']]">ParentApp</a>

<router-outlet name="alert"></router-outlet>

{aux: '/alert',component:Weather, name:'Alert'}

https://github.com/kittencup/angular2-router-example/blob/master/src/app/product/Product.ts