本文整理匯總了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);
});