本文整理汇总了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!') },