2015-12-13 18:15:46 -05:00
|
|
|
/* FOR DOCS ... MUST MATCH ClickMeComponent template
|
|
|
|
// #docregion click-me-button
|
|
|
|
<button (click)="onClickMe()">Click me!</button>
|
|
|
|
// #enddocregion click-me-button
|
|
|
|
*/
|
|
|
|
|
|
|
|
// #docregion
|
2016-05-03 08:06:32 -04:00
|
|
|
import { Component } from '@angular/core';
|
2015-12-13 18:15:46 -05:00
|
|
|
|
|
|
|
// #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
|