angular-docs-cn/typing_spec/basic_spec.ts

18 lines
351 B
TypeScript
Raw Normal View History

///<reference path="../dist/docs/typings/angular2/angular2.d.ts"/>
import {Component, bootstrap, View} from 'angular2/angular2'
@Component({
selector: 'my-app'
})
@View({
template: '<h1>Hello {{ name }}</h1>'
})
// Component controller
class MyAppComponent {
name: string;
constructor() { this.name = 'Alice'; }
}
bootstrap(MyAppComponent);