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


TypeScript _.map方法代码示例

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


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

示例1: function

		this.getUsersAndGroups = async function() {
			var response = await http.get('/directory/sharebookmark/' + this.id);
			this.users = _.map(response.data.users, function(item) {
				return new directory.User(item);
			});
			this.groups = response.data.groups;
			directory.directory.sortGroups(this.groups);
			this.groups = _.map(this.groups, function(item) {
				return new directory.Group(item);
			});
		}
开发者ID:entcore,项目名称:entcore,代码行数:11,代码来源:model.ts

示例2: function

				init: function(){
					var source = this.source;
					this.me = model.me;
					this.lang = lang;
					if(source.customLinks){
						this.links = source.customLinks;
						this.custom = true;
						this.snipletDisplay = {};
						return;
					}
                    this.source.landingPage = this.snipletResource.landingPage;
		    this.source._id = this.snipletResource._id;
                    this.links = _.map(this.snipletResource.pages.all, (page) => {
                        let href = '#/website/' + this.source._id + '/' + page.titleLink;
                        if (window.location.hash.startsWith('#/preview/')) {
                            href = '#/preview/' + this.source._id + '/' + page.titleLink;
                        }
						return {
							title: page.title,
                            href: href,
                            published: page.published,
							index: page.index
						}
                    });
					console.log(this.links);
                    this.links = _.reject(this.links, (l) => l.published === false);
					model.one('refresh-nav', () => this.init());
					this.$apply('links')
				},
开发者ID:web-education,项目名称:pages,代码行数:29,代码来源:behaviours.ts

示例3: init

                function init(subjectScheduled){
                    SubjectCopyService.resolveBySubjectScheduled_force(subjectScheduled).then(
                        function () {
                            scope.subjectCopyList = SubjectCopyService.getListBySubjectScheduled(subjectScheduled);
                            scope.subjectCopyList.forEach(copy => {
                                if(copy.is_corrected){
                                    scope.score.sum += copy.final_score;
                                    scope.score.nb++;
                                }
                            });
                            CorrectionService.automaticCorrection(scope.subjectCopyList, scope.selectedSubjectScheduled);
                        }
                    );

                    let r = _.map(_.union(scope.selectedSubjectScheduled.scheduled_at.userList, scope.selectedSubjectScheduled.scheduled_at.groupList), _.clone);

                    let total = r.length;
                    let current = 1;
                    _.forEach(r, function (obj) {
                        if (total !== current) obj.name = obj.name + ' - ';
                        current++;
                    });

                    scope.lUserGroup = r;
                    scope.selectedSubjectScheduled.lUserGroup = scope.lUserGroup;
                }
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:26,代码来源:teacherDashboardCorrectionCopyList.ts

示例4: function

 send: function () {
     this.message.to = _.map(this.snipletResource.shared, function (shared) { return shared.userId || shared.groupId });
     this.message.to.push(this.snipletResource.owner.userId);
     http().postJson('/conversation/send', this.message).done(function () {
         notify.info('ml.sent');
     }).e401(function () { });
     this.message = {}
 }
开发者ID:entcore,项目名称:entcore,代码行数:8,代码来源:behaviours.ts

示例5: async

 $scope.updateFoundUsers = async (search, model, founds, restriction?: boolean) => {
     var include = [];
     var exclude = model || [];
     if ($scope.mail) {
         include = _.map($scope.mail.displayNames, function (item) {
             return new User(item[0], item[1]);
         });
     }
     var users = await Conversation.instance.users.findUser(search, include, exclude, restriction);
     Object.assign(founds, users, { length: users.length });
 };
开发者ID:entcore,项目名称:entcore,代码行数:11,代码来源:controller.ts

示例6: function

                ArchivesService.getListArchivedSubjectScheduledCopy(subjectScheduled.id , (array => {
                    scope.subjectCopyList = array;
                    let r = _.map(_.union(scope.selectedSubjectScheduled.scheduled_at.userList, scope.selectedSubjectScheduled.scheduled_at.groupList), _.clone);

                    let total = r.length;
                    let current = 1;
                    _.forEach(r, function (obj) {
                        if (total !== current) obj.name = obj.name + ' - ';
                        current++;
                    });

                    scope.lUserGroup = r;
                }))
开发者ID:OPEN-ENT-NG,项目名称:exercizer,代码行数:13,代码来源:dashboardArchivesCopyList.ts


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