本文整理匯總了TypeScript中ng2-toasty.ToastyService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastyService類的具體用法?TypeScript ToastyService怎麽用?TypeScript ToastyService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ToastyService類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
result => {
if (result.code === CodeConfig.SUCCESS) {
this.toastyService.info('用戶 ' + this.user.username + ' 注冊成功!!!');
// 跳轉到首頁
this.router.navigate(['/user/login']);
} else {
this.toastyService.error(ResultUtils.getError(result));
}
}
示例2: loginMethod
loginMethod() {
localStorage.setItem('currentUser', JSON.stringify({}));
this.toastyService.default({
title: "Login Try!",
msg: "Logging In....",
showClose: true,
timeout: 5000,
theme: "material"
});
/*this.loading = true;
this.authenticationService.login(this.model.username, this.model.password)
.subscribe(
data => {
this.router.navigate([this.returnUrl]);
},
error => {
this.alertService.error(error);
this.loading = false;
});
}*/
this.ss.change();
debugger;
this.router.navigate(['/home']);
}
示例3: 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);
}
});
示例4:
err => {
CookieUtils.clearBy(CommonConfig.AUTH_USER_NAME);
this.toastyService.error('登錄失敗, 請檢查您的用戶名或密碼');
return false;
});
示例5: toastWarning
toastWarning(title, msg) {
this.toastyService.warning({
title,
msg,
})
}
示例6: toastWait
toastWait(title, msg) {
this.toastyService.wait({
title,
msg,
})
}
示例7: toastSuccess
toastSuccess(title, msg) {
this.toastyService.success({
title,
msg,
})
}
示例8: toastInfo
toastInfo(title, msg) {
this.toastyService.info({
title,
msg,
})
}
示例9: toastError
toastError(title, msg) {
this.toastyService.error({
title,
msg,
})
}
示例10: toastDefault
toastDefault(title, msg) {
this.toastyService.default({
title,
msg,
})
}