angular/aio/content/examples/ts-to-js/ts/src/app/confirm.component.ts
2017-04-24 14:00:51 +01:00

22 lines
463 B
TypeScript

import { Component, EventEmitter, Input, Output } from '@angular/core';
// #docregion
@Component({
selector: 'app-confirm',
templateUrl: './confirm.component.html'
})
export class ConfirmComponent {
@Input() okMsg = '';
@Input('cancelMsg') notOkMsg = '';
@Output() ok = new EventEmitter();
@Output('cancel') notOk = new EventEmitter();
onOkClick() {
this.ok.emit(true);
}
onNotOkClick() {
this.notOk.emit(true);
}
}
// #enddocregion