本文整理匯總了TypeScript中ng2-toasty.ToastyService.default方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastyService.default方法的具體用法?TypeScript ToastyService.default怎麽用?TypeScript ToastyService.default使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ng2-toasty.ToastyService
的用法示例。
在下文中一共展示了ToastyService.default方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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']);
}
示例2: 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);
}
});
示例3: toastDefault
toastDefault(title, msg) {
this.toastyService.default({
title,
msg,
})
}
示例4: ngOnInit
ngOnInit() {
localStorage.removeItem('currentUser');
this.toastyService.default('Please login !!!');
this.router.navigate(['/home']);
}