2016-03-08 16:36:48 -05:00
|
|
|
import {Component} from 'angular2/core';
|
2015-12-11 16:31:30 -05:00
|
|
|
import {bootstrap} from 'angular2/platform/browser';
|
2015-10-11 01:11:13 -04:00
|
|
|
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router';
|
2015-08-04 18:08:59 -04:00
|
|
|
|
|
|
|
@Component({
|
2016-03-08 16:36:48 -05:00
|
|
|
selector: 'my-app',
|
2015-08-04 18:08:59 -04:00
|
|
|
template: '<h1>Hello</h1>',
|
|
|
|
})
|
|
|
|
class FooCmp {
|
2015-08-27 16:19:24 -04:00
|
|
|
constructor(a: string, b: number) {}
|
2015-08-04 18:08:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
2016-03-08 16:36:48 -05:00
|
|
|
selector: 'my-app',
|
2015-08-04 18:08:59 -04:00
|
|
|
template: '<h1>Hello {{ name }}</h1><router-outlet></router-outlet>',
|
2015-08-18 17:46:35 -04:00
|
|
|
directives: ROUTER_DIRECTIVES
|
2015-08-04 18:08:59 -04:00
|
|
|
})
|
|
|
|
@RouteConfig([
|
|
|
|
{path: '/home', component: FooCmp}
|
|
|
|
])
|
|
|
|
class MyAppComponent {
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
constructor() { this.name = 'Alice'; }
|
|
|
|
}
|
|
|
|
|
2015-10-11 01:11:13 -04:00
|
|
|
bootstrap(MyAppComponent, ROUTER_PROVIDERS);
|