Angular 简单确认模式

Angular 简单确认模式,angular,bootstrap-modal,Angular,Bootstrap Modal,我想使用ng2 bs3模式来确认用户操作。 但我不知道如何从我的modal获得回调。 例如: @ViewChild('confirmModal') confirm: confirmModal; deleteItem(){ if(this.confirm.open()){ delete } else{ not delete } } 缩略模态码 <button type="button" class="btn btn-d

我想使用ng2 bs3模式来确认用户操作。 但我不知道如何从我的modal获得回调。 例如:

@ViewChild('confirmModal') confirm: confirmModal;
deleteItem(){
    if(this.confirm.open()){
        delete
    }
    else{
        not delete
    }
}    
缩略模态码

<button type="button" class="btn btn-default" data-dismiss="modal" (click)="modal.dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="modal.close()">Ok</button>
export class confirmModal{
    close() {
        this.modal.close();
    }
    open(){
        this.modal.open()
    }
}
取消
好啊
导出类confirmModal{
关闭(){
this.modal.close();
}
开(){
this.modal.open()
}
}
如何根据用户的选择返回true或false。 提前感谢您的回答