2017-07-16 45 views
-2

我想確認表中的刪除行但不使用在Angular中確認默認值。如何在Angular中確認對話框模式

+0

你有使用'priming'嗎?圖書館 –

+0

請參閱本文[** medium post **](https://medium.com/@aravind_12433/load-modal-component-dynamically-in-angular-5fda8e1dc3e7) – Aravind

+0

@Aravind您的鏈接無法打開。請檢查出:) –

回答

0

我建議你使用primeng confirm Dialogue box

HTML(使用P-confirbox指令)

<p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425"></p-confirmDialog> 

<button type="text" (click)="confirm()" pButton icon="fa-check" label="Confirm"></button> 

導入primeng在您的組件,並通過以下方式

import {ConfirmDialogModule,ConfirmationService} from 'primeng/primeng'; 

export class ConfirmDialogDemo { 

    constructor(private confirmationService: ConfirmationService) {} 

    confirm() { 
     this.confirmationService.confirm({ 
      message: 'Are you sure that you want to perform this action?', 
      accept:() => { 
       //Actual logic to perform a confirmation 
      } 
     }); 
    } 
} 
致電確認框
+0

我嘗試這個,但確認沒有彈出:( –

+0

清楚地閱讀該文件,然後你就可以瞭解 –