2015-08-04 15:32:17 -07:00
|
|
|
import {bootstrap, Component, View, NgFor, ViewEncapsulation} from 'angular2/bootstrap';
|
2015-05-22 13:01:23 -07:00
|
|
|
import {MdButton, MdAnchor} from 'angular2_material/src/components/button/button';
|
2015-08-20 14:28:25 -07:00
|
|
|
import {UrlResolver} from 'angular2/src/core/services/url_resolver';
|
2015-02-17 11:56:24 -08:00
|
|
|
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
|
|
|
|
import {bind} from 'angular2/di';
|
|
|
|
|
|
2015-08-04 15:32:17 -07:00
|
|
|
@Component({
|
|
|
|
|
selector: 'demo-app',
|
|
|
|
|
})
|
|
|
|
|
@View({
|
|
|
|
|
templateUrl: './demo_app.html',
|
|
|
|
|
directives: [MdButton, MdAnchor, NgFor],
|
|
|
|
|
encapsulation: ViewEncapsulation.NONE
|
|
|
|
|
})
|
2015-02-17 11:56:24 -08:00
|
|
|
class DemoApp {
|
|
|
|
|
previousClick: string;
|
|
|
|
|
action: string;
|
|
|
|
|
clickCount: number;
|
|
|
|
|
items: List<number>;
|
|
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
|
this.previousClick = 'Nothing';
|
|
|
|
|
this.action = "ACTIVATE";
|
|
|
|
|
this.clickCount = 0;
|
2015-05-22 13:01:23 -07:00
|
|
|
this.items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
2015-02-17 11:56:24 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
click(msg: string) {
|
|
|
|
|
this.previousClick = msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submit(msg: string, event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
this.previousClick = msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
increment() {
|
|
|
|
|
this.clickCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function main() {
|
|
|
|
|
commonDemoSetup();
|
2015-07-27 14:15:02 -07:00
|
|
|
bootstrap(DemoApp, [bind(UrlResolver).toValue(new DemoUrlResolver())]);
|
2015-02-17 11:56:24 -08:00
|
|
|
}
|