angular-docs-cn/public/docs/_examples/cb-ts-to-js/ts/app/confirm.component.ts

23 lines
506 B
TypeScript

import { Component, EventEmitter, Input, Output } from '@angular/core';
// #docregion
@Component({
moduleId: module.id,
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