2015-08-04 18:08:59 -04:00
|
|
|
///<reference path="../dist/docs/typings/angular2/angular2.d.ts"/>
|
|
|
|
///<reference path="../dist/docs/typings/angular2/router.d.ts"/>
|
|
|
|
|
|
|
|
import {Component, bootstrap, View} from 'angular2/angular2';
|
2015-08-18 17:46:35 -04:00
|
|
|
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_BINDINGS} from 'angular2/router';
|
2015-08-04 18:08:59 -04:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-app'
|
|
|
|
})
|
|
|
|
@View({
|
|
|
|
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({
|
|
|
|
selector: 'my-app'
|
|
|
|
})
|
|
|
|
@View({
|
|
|
|
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-08-18 17:46:35 -04:00
|
|
|
bootstrap(MyAppComponent, ROUTER_BINDINGS);
|