本文整理汇总了TypeScript中ui/dialogs.alert函数的典型用法代码示例。如果您正苦于以下问题:TypeScript alert函数的具体用法?TypeScript alert怎么用?TypeScript alert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了alert函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: signin
signin(email:string){
console.info(email);
if(!validator.validate(email)){
alert("invalid email address");
}
this._router.navigate(["Home"]);
}
示例2: alert
export function alert(message: string) {
return dialogsModule.alert({
title: "Groceries",
okButtonText: "OK",
message: message
});
}
示例3: alert
/**
* Show alert with the message.
* @param message The message.
* @param title Optional alert title. Defaults to 'Racket O Meter'
*/
public alert(message: string, title?: string): Promise<void> {
return alert({
title: title || "Racket O Meter",
message,
okButtonText: "OK",
});
}
示例4: function
onMessageReceivedCallback: function(message) {
dialogs.alert({
title: "Push message: " + (message.title !== undefined ? message.title : ""),
message: JSON.stringify(message.body),
okButtonText: "W00t!"
});
},
示例5: onRejected
private onRejected(error: any) {
console.log(error);
alert({
title: 'Loading Error',
message: LOADING_ERROR,
okButtonText: 'Ok'
});
}
示例6: displayAlertDialog
displayAlertDialog() {
// >> alert-dialog-code
let options = {
title: "Race selection",
message: "Race chosen: Unicorn",
okButtonText: "OK"
};
dialogs.alert(options).then(() => {
console.log("Race chosen!");
});
// << alert-dialog-code
}
示例7: getLocation
getLocation() {
alert({message:"Getting your location !", okButtonText: "ok, thanks"});
this.geolocatonService.getLocation(
loc => {
if (loc) {
this.latitude = String(loc.latitude);
this.longitude = String(loc.longitude);
}
},
error => {
console.log("Error: " + error.message);
});
}
示例8: loadRegions
public loadRegions(args: EventData) : void{
this.logger.Notify("time to load regions");
if(args){
this.logger.Notify("There are args");
//to do animate transition
}
alert("nav is broken - not sure why.");
let promise: Promise<any, any> = this.router.navigate(["Regions"]);
promise.then(() => {
this.logger.Notify("I Should have navigated from start -> regions");
});
promise.catch(() => {
this.logger.Notify("I failed navigating from start -> regions");
});
}
示例9: alert
public alert(msg: string): Promise<any> {
return dialogs.alert(msg);
}
示例10: setTimeout
setTimeout(() => {
dialogs.alert(`${msg} For real. It's really working :)`).then(() => console.log(`Dialog closed.`));
}, 2000);