本文整理匯總了TypeScript中@ng-bootstrap/ng-bootstrap.NgbModal.open方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript NgbModal.open方法的具體用法?TypeScript NgbModal.open怎麽用?TypeScript NgbModal.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ng-bootstrap/ng-bootstrap.NgbModal
的用法示例。
在下文中一共展示了NgbModal.open方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: openConfirmCompleteAllModal
openConfirmCompleteAllModal(confirmCompleteAllModal): void {
this.modalService.open(confirmCompleteAllModal).result.then((result) => {
if ('yes' === result) {
this.listService.completeAllItems();
}
});
}
示例2: openConfirmCompleteModal
openConfirmCompleteModal(confirmCompleteModal): void {
this.modalService.open(confirmCompleteModal).result.then((result) => {
if ('yes' === result) {
this.listService.completeItems(this.department);
}
});
}
示例3: open_modal
private open_modal(content) {
this.ngbModalService.open(content).result.then((result) => {
}, (reason) => {
console.log(reason);
});
}
示例4: openDatasetHistoryModal
openDatasetHistoryModal(dataset: Dataset, sessionData: SessionData) {
const modalRef = this.ngbModal.open(DatasetHistorymodalComponent, {
size: "lg"
});
modalRef.componentInstance.dataset = dataset;
modalRef.componentInstance.sessionData = sessionData;
}
示例5: openDeleteCollectionModal
private openDeleteCollectionModal(content) {
this.modalService.open(content).result.then((result) => {
if(result == 'confirm')
this.deleteCollection();
}, (reason) => {
});
}
示例6: staticModalShow
staticModalShow() {
const activeModal = this.modalService.open(DefaultModal, {size: 'sm',
backdrop: 'static'});
activeModal.componentInstance.modalHeader = 'Static modal';
activeModal.componentInstance.modalContent = `This is static modal, backdrop click
will not close it. Click Ă or confirmation button to close modal.`;
}
示例7: deploy
deploy() {
let deployed: boolean = true;
// close the draw as we no longer need it
this.activeDrawer.close();
const confirmModalRef = this.modalService.open(ReplaceComponent);
confirmModalRef.componentInstance.mainMessage = 'Your Business Network Definition currently in the Playground will be removed & replaced.';
confirmModalRef.componentInstance.supplementaryMessage = 'Please ensure that you have exported any current model files in the Playground.';
confirmModalRef.componentInstance.resource = 'definition';
return confirmModalRef.result.then((result) => {
if (result === true) {
this.deployInProgress = true;
return this.sampleBusinessNetworkService.updateBusinessNetwork(this.currentBusinessNetwork);
} else {
deployed = false;
}
})
.then(() => {
this.deployInProgress = false;
this.finishedSampleImport.emit({deployed: deployed});
})
.catch((error) => {
this.deployInProgress = false;
this.alertService.errorStatus$.next(error);
this.finishedSampleImport.emit({deployed: false, error: error});
});
}
示例8:
private openModal<T extends ModalDialog<TResult>, TResult>(settings: IModalSettings<T, TResult>): void
{
const modalRef: NgbModalRef = this.modalService.open(settings.type);
const component: T = modalRef.componentInstance;
const reportResult = (res) =>
{
console.log(`dialog result:`, res);
if (res)
{
settings.onSuccess(res);
}
};
const reportFailure = (reason) =>
{
if (reason)
{
console.log('dialog failed:', reason);
}
};
if (settings.init)
settings.init(component);
modalRef.result
.then(reportResult)
.catch(reportFailure);
}
示例9: open
open(content, level: number) {
this.level = level;
this.checklistService
.getChecklist(level)
.subscribe(checklistItems => { this.checklistItems = checklistItems });
this.modalService.open(content, { size: 'lg' })
}
示例10: openContactSupportModal
openContactSupportModal(log = null) {
const modalRef = this.modalService.open(ContactSupportModalComponent, {
size: "lg",
backdrop: "static", // don't close on backdrop click
});
modalRef.componentInstance.log = log;
}