25 lines
543 B
TypeScript
25 lines
543 B
TypeScript
/* FOR DOCS ... MUST MATCH ClickMeComponent template
|
|
// #docregion click-me-button
|
|
<button (click)="onClickMe()">Click me!</button>
|
|
// #enddocregion click-me-button
|
|
*/
|
|
|
|
// #docregion
|
|
import {Component} from 'angular2/core';
|
|
|
|
// #docregion click-me-component
|
|
@Component({
|
|
selector: 'click-me',
|
|
template: `
|
|
<button (click)="onClickMe()">Click me!</button>
|
|
{{clickMessage}}`
|
|
})
|
|
export class ClickMeComponent {
|
|
clickMessage = '';
|
|
|
|
onClickMe(){
|
|
this.clickMessage ='You are my hero!';
|
|
}
|
|
}
|
|
// #enddocregion click-me-component
|