本文整理汇总了TypeScript中tns-core-modules/ui/dialogs.confirm函数的典型用法代码示例。如果您正苦于以下问题:TypeScript confirm函数的具体用法?TypeScript confirm怎么用?TypeScript confirm使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了confirm函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: onShowDialog
onShowDialog(title: string, result: string) {
let options: any = {
title: title,
message: result,
okButtonText: "Ok"
}
confirm(options).then((result: boolean) => {
console.log(result);
})
}
示例2: onShowDialog
onShowDialog() {
let options = {
title: "Dialog",
message: "Message",
okButtonText: "Yes",
cancelButtonText: "No"
}
confirm(options).then((result: boolean) => {
console.log(result);
})
}
示例3: test_DummyTestForSnippetOnly1
export function test_DummyTestForSnippetOnly1() {
// >> dialog-confirm
var options = {
title: "Race Selection",
message: "Are you sure you want to be an Elf?",
okButtonText: "Yes",
cancelButtonText: "No",
neutralButtonText: "Cancel"
};
dialogs.confirm(options).then((result: boolean) => {
// result can be true/false/undefined
console.log(result);
});
// << dialog-confirm
}
示例4: confirmName
public confirmName(args: observable.EventData) {
dialogs.confirm({
title: "Name",
message: "Do you want to change the name?",
cancelButtonText: "No",
neutralButtonText: "Ignore",
okButtonText: "Yes"
}).then((confirmResult) => {
console.log("### Result: " + confirmResult);
if (confirmResult) {
this.set("name", "John Reese");
}
else {
this.set("name", "Harold Finch");
}
});
}