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