当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript notify.error方法代码示例

本文整理汇总了TypeScript中entcore.notify.error方法的典型用法代码示例。如果您正苦于以下问题:TypeScript notify.error方法的具体用法?TypeScript notify.error怎么用?TypeScript notify.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entcore.notify的用法示例。


在下文中一共展示了notify.error方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: function

                scope.saveImportSubject = function() {
                    if (!scope.importSubject.title || scope.importSubject.title.length === 0) {
                        notify.error('exercizer.check.title');
                    } else if (!scope.fileImportName || scope.fileImportName.length === 0) {
                        notify.error('exercizer.import.check.file');
                    } else {
                        scope.importSubject.folder_id = scope.currentFolderId;

                        scope.loadingImport = true;

                        ImportService.importFile(scope.newFiles[0], scope.importSubject).then(function (objectData) {
                            SubjectService.currentSubjectId = objectData.subject.id;
                            scope.loadingImport = false;
                            scope.stateImport = 'result';
                            scope.grainImportCount = objectData.count;
                            scope.unsupported = objectData.unsupported;
                            scope.newFiles = undefined;
                            scope.$apply();
                        }, function (err) {
                            scope.loadingImport = false;
                            notify.error(err);
                            scope.$apply();
                        });
                    }
                };
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:25,代码来源:teacherDashboardSubjectList.ts

示例2:

			.e400(function(e){
				let errorMsg: string = JSON.parse(e.responseText).error;
				if(errorMsg.includes('already exists') || errorMsg.includes('existe dĂŠjĂ ')) {
					notify.error('directory.notify.loginUpdate.error.alreadyExists');
				} else {
					notify.error(errorMsg);
				}
			}.bind(this));
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:account.ts

示例3:

				.e400(function(e){
					this.sync();
					var error = JSON.parse(e.responseText).message;
					var errWithIdx = error.split(/\s/);
					if (errWithIdx.length === 2) {
						notify.error(lang.translate(errWithIdx[0]) + errWithIdx[1]);
					} else {
						if(error.indexOf('already exists') !== -1){
							notify.error('directory.import.already.exists');
						}
						else{
							notify.error(error);
						}
					}
				}.bind(this));
开发者ID:entcore,项目名称:entcore,代码行数:15,代码来源:model.ts

示例4: async

 const printForAllUsers = async () => {
     try {
         if (_printingAll) return;
         _printingAll = true;
         // print all
         let type: ReportType = null;
         switch ($scope.userExport.type) {
             case ExportTypes.CSV:
                 type = "csv";
                 break;
             case ExportTypes.Detail:
                 type = "pdf";
                 break;
             case ExportTypes.Simple:
                 type = "simplePdf";
                 break;
             case ExportTypes.Mail:
             default:
                 throw "Invalid report type: " + $scope.userExport.type;
         }
         const school = getSchool();
         await directoryService.generateReport({
             ids: _usersForMailing.map(u => u.id),
             structureId: school.id,
             type
         })
     } catch (e) {
         notify.error(lang.translate("classAdmin.download.failed"))
     } finally {
         _printingAll = false;
     }
 }
开发者ID:entcore,项目名称:entcore,代码行数:32,代码来源:userExport.ts

示例5: function

	$scope.resetPasswords = async function (user) {
		if (!model.me.email) {
			notify.error("classAdmin.reset.error");
			return;
		}
		try {
			if (user) {
				await directoryService.resetPassword([user])
			} else {
				await directoryService.resetPassword(_selection)
			}
			notify.success("directory.admin.reset.code.sent")
		} catch (e) {
			notify.error("directory.admin.reset.code.send.error");
		}
	}
开发者ID:entcore,项目名称:entcore,代码行数:16,代码来源:controller.ts

示例6: function

 $scope.openUserInfos = async function (user: User) {
     try {
         await selectFirstUser(user);
         $scope.showLoginInput = false;
         $scope.openLightbox('admin/user-infos');
         $scope.safeApply();
     } catch (e) {
         notify.error('unexpected.error');
     }
 }
开发者ID:entcore,项目名称:entcore,代码行数:10,代码来源:userInfos.ts

示例7: function

            scope.sendReminder = function() {
                var copyIds = [];

                angular.forEach(scope.reminderCopies, function(copy){
                    copyIds.push(copy.id);
                });

                if (scope.remind.step === 'auto') {
                    SubjectCopyService.remindAutomaticCopies(copyIds, scope.selectedSubjectScheduled.id).then(
                        function () {
                            resetRemind();
                            scope.isDisplayed = false;
                            notify.info('exercizer.reminder.sent');
                        },
                        function (err) {
                            notify.error(err);
                        }
                    );
                } else {
                    if (!scope.remind.subject || scope.remind.subject === '') {
                        notify.error('exercizer.reminder.check.subject');
                    } else if (!scope.remind.body || scope.remind.body === '') {
                        notify.error('exercizer.reminder.check.body');
                    } else {
                        SubjectCopyService.remindCustomCopies(copyIds, scope.remind.subject, scope.remind.body).then(
                            function () {
                                resetRemind();
                                scope.isDisplayed = false;
                                notify.info('exercizer.reminder.sent');
                            },
                            function (err) {
                                notify.error(err);
                            }
                        );
                    }
                }
            };
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:37,代码来源:reminders.ts

示例8: function

 scope.publish = function() {
     if (!scope.hasAgreedToPublish) {
         notify.error('exercizer.service.check.licence.library')
     } else if (scope.selection.selectedSubjectLessonTypeId === null || scope.selection.selectedSubjectLessonTypeId === 'null' || scope.selection.selectedSubjectLessonLevelId === null || scope.selection.selectedSubjectLessonLevelId === 'null') {
         notify.error('exercizer.service.check.level.library')
     } else {
         scope.isPublicationOnGoing = true;
         var file;
         if (scope.newFiles && scope.newFiles.length > 0) {
             file = scope.newFiles[0];                                    
         }
         SubjectLibraryService.publish(scope.subject, StringISOHelper.toISO(scope.cc.authorsContributors), scope.selection.selectedSubjectLessonTypeId, scope.selection.selectedSubjectLessonLevelId, scope.selectedSubjectTagList, file).then(
             function() {
                 scope.isPublicationOnGoing = false;
                 notify.info('exercizer.service.save.library');
                 scope.hide();
             },
             function(err) {
                 scope.isPublicationOnGoing = false;
                 notify.error(err);
             }
         );
     }
 };
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:24,代码来源:teacherDashboardPublishToLibrary.ts


注:本文中的entcore.notify.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。