2015-12-13 18:15:46 -05:00
|
|
|
// #docregion
|
2016-05-03 08:06:32 -04:00
|
|
|
import { Component } from '@angular/core';
|
2015-12-13 18:15:46 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'click-me2',
|
|
|
|
template: `
|
|
|
|
<button (click)="onClickMe2($event)">No! .. Click me!</button>
|
|
|
|
{{clickMessage}}`
|
|
|
|
})
|
2016-06-12 18:41:33 -04:00
|
|
|
export class ClickMe2Component {
|
2015-12-13 18:15:46 -05:00
|
|
|
clickMessage = '';
|
|
|
|
clicks = 1;
|
|
|
|
|
2016-06-07 19:06:25 -04:00
|
|
|
onClickMe2(event: any) {
|
|
|
|
let evtMsg = event ? ' Event target is ' + event.target.tagName : '';
|
|
|
|
this.clickMessage = (`Click #${this.clicks++}. ${evtMsg}`);
|
2015-12-13 18:15:46 -05:00
|
|
|
}
|
|
|
|
}
|