2015-07-22 10:18:04 -07:00
|
|
|
import {bootstrap, Component, View} from 'angular2/bootstrap';
|
2015-05-22 13:01:23 -07:00
|
|
|
import {MdRadioButton, MdRadioGroup} from 'angular2_material/src/components/radio/radio_button';
|
|
|
|
import {MdRadioDispatcher} from 'angular2_material/src/components/radio/radio_dispatcher';
|
2015-02-17 11:56:24 -08:00
|
|
|
import {UrlResolver} from 'angular2/src/services/url_resolver';
|
|
|
|
import {commonDemoSetup, DemoUrlResolver} from '../demo_common';
|
|
|
|
import {bind} from 'angular2/di';
|
|
|
|
|
2015-06-29 11:15:49 -07:00
|
|
|
@Component({selector: 'demo-app', viewInjector: [MdRadioDispatcher]})
|
2015-05-22 13:01:23 -07:00
|
|
|
@View({templateUrl: './demo_app.html', directives: [MdRadioGroup, MdRadioButton]})
|
2015-02-17 11:56:24 -08:00
|
|
|
class DemoApp {
|
|
|
|
thirdValue;
|
|
|
|
groupValueChangeCount;
|
|
|
|
individualValueChanges;
|
|
|
|
pokemon;
|
|
|
|
someTabindex;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this.thirdValue = 'dr-who';
|
|
|
|
this.groupValueChangeCount = 0;
|
|
|
|
this.individualValueChanges = 0;
|
|
|
|
this.pokemon = '';
|
|
|
|
this.someTabindex = 888;
|
|
|
|
}
|
|
|
|
|
|
|
|
chooseCharmander() {
|
|
|
|
this.pokemon = 'fire';
|
|
|
|
}
|
|
|
|
|
|
|
|
onGroupChange() {
|
|
|
|
this.groupValueChangeCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
onIndividualClick() {
|
|
|
|
this.individualValueChanges++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function main() {
|
|
|
|
commonDemoSetup();
|
2015-05-22 13:01:23 -07:00
|
|
|
bootstrap(DemoApp, [bind(UrlResolver).toValue(new DemoUrlResolver())]);
|
2015-02-17 11:56:24 -08:00
|
|
|
}
|