本文整理汇总了TypeScript中ngx-prx-styleguide.ModalService类的典型用法代码示例。如果您正苦于以下问题:TypeScript ModalService类的具体用法?TypeScript ModalService怎么用?TypeScript ModalService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ModalService类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: confirmRemoveFile
confirmRemoveFile() {
if (this.hasStories() && !this.file.isNew) {
let confirmMsg = `Are you sure you want to remove the ${this.file.label} segment?
This change could affect your already published episodes.`;
this.modal.confirm('', confirmMsg, (confirm) => {
if (confirm) {
this.removeFile();
}
});
} else {
this.removeFile();
}
}
示例2: confirmRemoveVersion
confirmRemoveVersion(version: AudioVersionTemplateModel) {
if (this.hasStories() && !version.isNew) {
let confirmMsg = `Are you sure you want to remove the ${version.label} template?
This change could affect your already published episodes.`;
this.modal.confirm('', confirmMsg, (confirm) => {
if (confirm) {
this.removeVersion(version);
}
});
} else {
this.removeVersion(version);
}
}
示例3: handleError
handleError(err) {
this.modal.show({
title: 'Uncaught ' + (err.name || 'Error'),
body: `
<p>${err.message}</p>
<hr/>
<pre>${err.stack}</pre>
`,
secondaryButton: 'Okay',
height: 400,
width: 700
});
this.defaultHandler.handleError(err);
}
示例4: confirmAddFile
confirmAddFile(event: MouseEvent, version: AudioVersionTemplateModel) {
if (event.target['blur']) {
event.target['blur']();
}
if (this.hasStories() && !version.isNew) {
let confirmMsg = `Are you sure you want to add a segment to your ${version.label} template?
This change could invalidate your already published episodes.`;
this.modal.confirm('', confirmMsg, (confirm) => {
if (confirm) {
this.addFile(version);
}
});
} else {
this.addFile(version);
}
}
示例5: showProblems
showProblems() {
let normals = this.formatInvalids(false);
let stricts = this.formatInvalids(true).filter(s => normals.indexOf(s) === -1);
let title = 'Validation errors';
let msg = '';
normals.forEach(s => msg += `<li class="error">${s}</li>`);
if (this.isPublished) {
stricts.forEach(s => msg += `<li class="error">${s}</li>`);
}
if (this.id && !this.isPublished) {
stricts.forEach(s => msg += `<li>${s}</li>`);
if (normals.length === 0) {
title = 'Not ready to publish';
}
}
this.modal.show({title: title, body: `<ul>${msg}</ul>`, secondaryButton: 'Okay'});
}