本文整理汇总了TypeScript中tns-core-modules/ui/dialogs.alert函数的典型用法代码示例。如果您正苦于以下问题:TypeScript alert函数的具体用法?TypeScript alert怎么用?TypeScript alert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了alert函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: onDayViewEventSelected
onDayViewEventSelected(args: CalendarDayViewEventSelectedData) {
var event: CalendarEvent = args.eventData;
alert(
{
title: "Event Selected",
message: event.title,
okButtonText: "OK"
});
}
示例2: alert
model.onNotificationActionTakenCallback = (actionIdentifier: string, message: firebase.Message, inputText?: string) => {
console.log(`onNotificationActionTakenCallback fired! \n\r Message: ${JSON.stringify(message)}, \n\r Action taken: ${actionIdentifier}`);
alert({
title: "Interactive push action",
message: `Message: ${JSON.stringify(message)}, \n\r Action taken: ${actionIdentifier}` + (inputText ? `, \n\r Input text: ${inputText}` : ""),
okButtonText: "Nice!"
});
};
示例3: alertName
public alertName(args: observable.EventData) {
dialogs.alert({
title: "Name",
message: "The name will change.",
okButtonText: "OK"
}).then((alertResult) => {
console.log("### Result: " + alertResult);
this.set("name", "John Reese");
});
}
示例4: onTap
public onTap() {
this.myCommitDataFormComp.dataForm.commitAll();
alert(
{
title: "Registration Details",
message: this.myCommitDataFormComp.dataForm.source.toString(),
okButtonText: "OK"
});
}
示例5: onTap
export function onTap() {
var options = {
title: "Race selection",
message: "Race chosen: Unicorn",
okButtonText: "OK"
};
alert(options).then(() => {
console.log("Race chosen!");
});
}
示例6: test_DummyTestForSnippetOnly2
export function test_DummyTestForSnippetOnly2() {
// >> dialog-alert
var options = {
title: "Race Selection",
message: "Race Chosen: Elf",
okButtonText: "OK"
};
dialogs.alert(options).then(() => {
console.log("Race Chosen!");
});
// << dialog-alert
}
示例7: onTap
// >> angular-dataform-custom-validation
public onTap() {
let isValid = true;
const p1 = this.myCustomDataFormComp.dataForm.getPropertyByName("username");
const p2 = this.myCustomDataFormComp.dataForm.getPropertyByName("password");
if (p1.valueCandidate.toLowerCase() !== "admin1") {
p1.errorMessage = "Use admin1 as username.";
this.myCustomDataFormComp.dataForm.notifyValidated("username", false);
isValid = false;
} else {
this.myCustomDataFormComp.dataForm.notifyValidated("username", true);
}
if (p2.valueCandidate.toLowerCase() !== "pass1") {
p2.errorMessage = "Use pass1 as password.";
this.myCustomDataFormComp.dataForm.notifyValidated("password", false);
isValid = false;
} else {
this.myCustomDataFormComp.dataForm.notifyValidated("password", true);
}
this._text = null;
if (!isValid) {
this._text = "Username and Password are not recognized.";
} else {
this._text = "";
this.myCustomDataFormComp.dataForm.commitAll();
alert(
{
title: "Successful Login",
message: "Welcome, " + this.myCustomDataFormComp.dataForm.source.username,
okButtonText: "OK"
});
}
}
开发者ID:telerik,项目名称:nativescript-ui-samples-angular,代码行数:40,代码来源:dataform-custom-validation.component.ts
示例8: setTimeout
setTimeout(() => {
dialogs.alert(`${msg} For real. It's really working :)`).then(() => console.log(`Dialog closed.`));
}, 2000);
示例9: alert
}, (err) => {
alert(err);
});