<!doctype html> <html> <head> <meta charset="utf-8"> <title>template - local var</title> <script type="text/javascript" src="lib/system@0.16.11.js"></script> <script type="text/javascript" src="lib/angular2.dev.js"></script> <script type="text/javascript" src="lib/system.config.js"></script> </head> <body> <ez-app></ez-app>
<script type="module">
import {Component,View,bootstrap} from "angular2/angular2";
@Component({selector:"ez-app"})
@View({
template:`
<h1>
<button (click)="changecolor()">变色</button>
I choose
<b #v_who>WHO?</b>
</h1>
<button (click)="v_who.textContent = 'Jason'">Jason</button>
<button (click)="v_who.textContent = 'Mary'">Mary</button>
<button (click)="v_who.textContent = 'Linda'">Linda</button>
<button (click)="v_who.textContent = 'Lincoln'">Lincoln</button>
<button (click)="v_who.textContent = 'Jimmy'">Jimmy</button>
<button (click)="v_who.textContent = 'Albert'">Albert</button>
`
})
class EzApp{
constructor(){
this.changecolor();
}
changecolor(){
}
}
bootstrap(EzApp);
</script>
</body> </html>