2
關閉模式我有一個自定義按鈕模型上點擊
<modal #modal>
<modal-header [show-close]="true">
Header Text
</modal-header>
<modal-body>
Body Text
</modal-body>
<modal-footer>
<button type="button" class="btn btn-default" data-dismiss="modal" (click)="modal.dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" (click)="SaveProject()">Ok</button>
</modal-footer>
</modal>
在組件方面我有代碼SaveProject()
SaveProject() {
// Some Logic
}
我想關閉模式的邏輯完成後, 。對於這一點,我在組件頁面
import { ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal';
實現了這個在出口類我有
modal: ModalComponent;
而在我的單擊事件我有
SaveProject() {
// Some Logic
this.modal.close();
}
但它不工作