{path: '/', name: 'Index', component: Home, useAsDefault: true},
{path: '/home', name: 'Home', component: Home},
{
path: '/administrationPanel/...',
name: 'AdminRoot',
loader: () => require('es6-promise!./admin/admin')('AdminRoot')
},
import {Component,OnInit} from 'angular2/core';
import {RouteConfig, Router} from 'angular2/router';
@Component({
selector: 'admin',
pipes: [],
providers: [],
directives: [],
styles: [``],
template: `<h1>From Admin!</h1>
<div><a [routerLink]=" ['./Tables'] ">Tables</a></div>
<router-outlet></router-outlet>`
})
@RouteConfig([
{path: '/tables', name: 'Tables', loader: () => require('es6-promise!./tables/tables.component')('Tables')}
])
export class AdminRoot implements OnInit {
ngOnInit() {
console.log('hello `Admin` component');
}
}
import {Component,OnInit} from 'angular2/core';
@Component({
selector: 'app',
pipes: [],
providers: [],
directives: [],
styles: [``],
template: `<h1>Tables,Man!</h1>`
})
export class Tables implements OnInit {
ngOnInit() {
console.log('hello `Table!` component');
}