本文整理匯總了TypeScript中ng2-toasty.ToastyService.success方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastyService.success方法的具體用法?TypeScript ToastyService.success怎麽用?TypeScript ToastyService.success使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-toasty.ToastyService
的用法示例。
在下文中一共展示了ToastyService.success方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: switch
this.toastService.toastTriggered.subscribe(toast => {
let toastOptions: ToastOptions = {
title: toast.title,
msg: toast.message,
showClose: true,
timeout: 5000,
theme: 'default'
};
switch (toast.type) {
case 'default': this.toastyService.default(toastOptions); break;
case 'info': this.toastyService.info(toastOptions); break;
case 'success': this.toastyService.success(toastOptions); break;
case 'wait': this.toastyService.wait(toastOptions); break;
case 'error': this.toastyService.error(toastOptions); break;
case 'warning': this.toastyService.warning(toastOptions); break;
default: this.toastyService.default(toastOptions);
}
});
示例2: toastSuccess
toastSuccess(title, msg) {
this.toastyService.success({
title,
msg,
})
}
示例3:
.subscribe((response) => {
this.back();
this.toastyService.success('Project created.');
}, (error) => {