本文整理汇总了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);
});
}
示例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')
},
示例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;
}
示例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 = {}
}
示例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 });
};
示例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;
}))