本文整理匯總了TypeScript中toastr.info函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript info函數的具體用法?TypeScript info怎麽用?TypeScript info使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了info函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: switch
this.toastsPromise.then((toasts: IToast[]) => {
for (let t of toasts){
//Setup callbacks to track dismisal status
let overrides: ToastrOptions = {
onclick: () => {
ToastService.acknowledgeToast(t.Id, this.context.pageContext.web.id);
},
onCloseClick: () => {
ToastService.acknowledgeToast(t.Id, this.context.pageContext.web.id);
}
};
switch (t.Severity){
case 'Warning':
toastr.warning(t.Message, t.Title, overrides);
break;
case 'Error':
toastr.error(t.Message, t.Title, overrides);
break;
case 'Success':
toastr.success(t.Message, t.Title, overrides);
break;
default:
toastr.info(t.Message, t.Title, overrides);
break;
}
}
}).catch((error: any): void => {
示例2:
listenerFunction = event => {
if (event.id === "saving") {
toastr.info(localizedNotification, "", {
positionClass: "toast-top-left",
preventDuplicates: true,
showDuration: 300,
hideDuration: 300,
timeOut: 1000,
extendedTimeOut: 1000,
showEasing: "swing",
showMethod: "fadeIn",
hideEasing: "linear",
hideMethod: "fadeOut",
messageClass: "toast-for-saved-message",
iconClass: ""
});
}
};
示例3: showInfoMessage
/**
* Show info message using toaster library
*/
showInfoMessage(message: string, title: string): void {
toastr.info(message, title);
}
示例4: info
info(message: string, title?: string) {
return toastr.info(message, title);
}
示例5: info
this.socket.on("UPDATE_REDUX", action => {
info("Realtime update coming in!");
this.store.dispatch(action)
});
示例6: next
return next().then((a: any) => { console.log(a.status); toastr.info(a.status); return a;});