本文整理匯總了TypeScript中ngx-toastr.ToastrService.success方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ToastrService.success方法的具體用法?TypeScript ToastrService.success怎麽用?TypeScript ToastrService.success使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ngx-toastr.ToastrService
的用法示例。
在下文中一共展示了ToastrService.success方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
this.apiService.updateDarkhast(rowData, this.editingRowKey).subscribe(() => {
this.toastr.success('تعداد با موفقیت کاهش یافت');
this.editingMode = false;
this.listDarkhastGrid.instance.cancelEditData();
e.cancel = true;
this.getListDarkhast();
}, (error) => {
示例2:
this.Api.login(details).subscribe(data=>{
if(data.StatusCode==200){
this.toaster.success('Login Successfll', 'Login Success');
this.router.navigate(['/dashboard'])
}
else{
this.toaster.error('Incorrect Username and pasword', 'Login Failed');
}
})
示例3:
this.dataService.createPost(this.addPostFormGroup.value).subscribe((response) => {
if(response.status == 201) {
this.toastr.success('Success', 'New post created successfully',{
timeOut: 1000,
progressBar: true,
progressAnimation: 'increasing'
});
this.router.navigate(['/index']);
}
});
示例4: tap
tap((res: any) => {
if (res instanceof HttpResponse && res.body.token) {
this.saveToken(res.body);
this.toast.success(
`Hello, ${JSON.parse(
localStorage.getItem("currentUser")
)['username']}`
);
this.router.navigate(["/home"]);
}
if (
res instanceof HttpResponse &&
res.body.success &&
res.url.endsWith("/signup")
) {
this.toast.success(res.body.message, "Success");
this.router.navigate(["/signin"]);
}
})
示例5: map
map(success => {
this.success = success
if (this.success.type === 'info') {
this.toastrService.info(this.success.message, this.success.type)
return this.success.type;
}
else {
this.toastrService.success(this.success.message, this.success.type)
return this.success.type;
}
},
示例6: setTimeout
.subscribe((apiResponse) => {
if (apiResponse.status == 200) {
this.toastr.success("Signed Up", "!SuccesFull");
setTimeout(() => {
this.goToSignIn();
}, 2000);//redirecting to signIn page
}
else {
this.toastr.error(apiResponse.message, "Error!");
}
},
示例7: tap
tap((res: HttpEvent<any>) => {
if (
res instanceof HttpResponse &&
res.body.token &&
res.url.endsWith("login")
) {
console.log("Here 1");
this.saveToken(res.body);
this.toastr.success("Successful login!", "Logged in!");
this.router.navigate(["/home"]);
}
if (
res instanceof HttpResponse &&
res.body.success &&
res.url.endsWith("signup")
) {
console.log("Here 2");
this.toastr.success(res.body.message, "Registered!");
this.router.navigate(["/signin"]);
}
})
示例8: showSavedMessage
showSavedMessage() {
if (this._savedSeverity === '' || this._savedMessage === '') {
return;
}
if (this._savedSeverity === 'error') {
this._toastr.error(this._savedMessage);
} else if (this._savedSeverity === 'warning') {
this._toastr.warning(this._savedMessage);
} else if (this._savedSeverity === 'info') {
this._toastr.info(this._savedMessage);
} else if (this._savedSeverity === 'success') {
this._toastr.success(this._savedMessage);
}
this._savedSeverity = '';
this._savedMessage = '';
}
示例9: setTimeout
.subscribe((apiResponse) => {
if (apiResponse.status == 200) {
this.toastr.success("Signed In", "Success");
console.log(apiResponse);
Cookie.set('authToken', apiResponse.data.authToken);
Cookie.set('receiverId', apiResponse.data.userDetails.userId);
Cookie.set('receiverName', `${apiResponse.data.userDetails.firstName} ${apiResponse.data.userDetails.lastName}`);
this.appService.setUserInfoInLocalStorage(apiResponse.data.userDetails);
setTimeout(() => {
this.router.navigate(['/chat']);
}, 2000);
}
else {
this.toastr.error(apiResponse.message);
}
},
示例10: tap
}), tap(_ => { this.toastrService.success('Address added successfully!', 'Success!') },