angular - Simple confirmation modal -


i want use ng2 bs3 modal confirm user action. don't know how callback modal. example:

@viewchild('confirmmodal') confirm: confirmmodal; deleteitem(){     if(this.confirm.open()){         delete     }     else{         not delete     } }     

and shortened modal code

<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()     } } 

how return true or false depending on user's choice. thank in advance answer.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -