本文整理汇总了TypeScript中@skyux/modals.SkyConfirmService.open方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SkyConfirmService.open方法的具体用法?TypeScript SkyConfirmService.open怎么用?TypeScript SkyConfirmService.open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@skyux/modals.SkyConfirmService
的用法示例。
在下文中一共展示了SkyConfirmService.open方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: openYesNoCancelConfirm
public openYesNoCancelConfirm() {
const dialog: SkyConfirmInstance = this.confirmService.open({
message: 'Do you wish to continue?',
type: SkyConfirmType.YesNoCancel
});
dialog.closed.subscribe((result: any) => {
this.selectedAction = result.action;
});
}
示例2: openYesCancelConfirmWithBody
public openYesCancelConfirmWithBody() {
const dialog: SkyConfirmInstance = this.confirmService.open({
message: 'Do you wish to continue?',
body: 'This could be dangerous!',
type: SkyConfirmType.YesCancel
});
dialog.closed.subscribe((result: any) => {
this.selectedAction = result.action;
});
}
示例3: openCustomConfirm
public openCustomConfirm() {
const dialog: SkyConfirmInstance = this.confirmService.open({
message: 'What option are you going to select?',
type: SkyConfirmType.Custom,
buttons: [
{ text: '1', action: 'foo', styleType: 'primary' },
{ text: '2', action: 'bar' },
{ text: '3', action: 'baz', autofocus: true }
]
});
dialog.closed.subscribe((result: any) => {
this.selectedAction = result.action;
});
}