本文整理汇总了TypeScript中md2.Md2Toast类的典型用法代码示例。如果您正苦于以下问题:TypeScript Md2Toast类的具体用法?TypeScript Md2Toast怎么用?TypeScript Md2Toast使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Md2Toast类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
this.userService.changePassword(passwordModel).then((result) => {
if (result.errorMessage === null) {
this.toast.show('Password changed successfully');
this.redirectionRoute.navigate(['']);
}
else {
this.toast.show(result.errorMessage);
}
this.loader.loader = false;
}, err => {
示例2: project
this.userService.userDelete(userId).then((result) => {
if (result === "") {
this.toast.show('user succesfully deleted');
this.getUsers();
this.loader.loader = false;
}
else {
this.toast.show('Remove the user from these project(s) ' + result +' and proceed to delete');
this.loader.loader = false;
}
});
示例3: canActivate
canActivate(): boolean {
if (this.userRole.Role === this.stringconstant.admin) {
return true;
}
else {
this.toast.show("You are not authorized to view this page");
return false;
}
}
示例4: addUser
addUser(userModel) {
this.loader.loader = true;
userModel.JoiningDate = new Date(userModel.JoiningDate);
let datePipeMinDate = new DatePipe("medium");
userModel.JoinDate = datePipeMinDate.transform(userModel.JoiningDate, "dd/MM/yyyy");
if (!this.isEmailExist) {
userModel.FirstName = userModel.FirstName.trim();
this.userService.registerUser(userModel).then((result) => {
this.toast.show('User added successfully.');
this.redirectionRoute.navigate(['user/list']);
this.loader.loader = false;
}, err => {
if (err.status === 400) {
this.toast.show('Email is invalid.');
} this.loader.loader = false;
});
}
else {
this.loader.loader = false;
this.toast.show('Email already exists.');
}
}
示例5:
}, err => {
if (err.status === 400) {
this.toast.show('Email is invalid.');
} this.loader.loader = false;
});
示例6:
this.groupService.addGroup(groupModel).then((result) => {
this.toast.show("Group added successfully.");
this.backToGroupList();
this.loader.loader = false;
}, err => {
示例7:
}, err => {
this.toast.show('Group must not be updated.');
this.loader.loader = false;
});
示例8:
this.userService.reSendMail(user.Id).then((response) => {
this.toast.show('Credentials re-send succesfully');
this.loader.loader = false;
}, err => {