本文整理汇总了TypeScript中entcore.idiom.addBundle方法的典型用法代码示例。如果您正苦于以下问题:TypeScript idiom.addBundle方法的具体用法?TypeScript idiom.addBundle怎么用?TypeScript idiom.addBundle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entcore.idiom
的用法示例。
在下文中一共展示了idiom.addBundle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: http
http().get('/userbook/person/birthday').done(function(birthdays){
lang.addBundle('/directory/i18n', function(){
Birthday.emptyList = lang.translate('nobirthday');
Birthday.birthdays = _.filter(birthdays, function(birthday){
return moment(birthday.birthDate).month() === moment().month();
});
Birthday.birthdays = Birthday.birthdays.sort(function(a, b){
return moment(a.birthDate).date() - moment(b.birthDate).date()
});
var classes = [];
classes = _.pluck(Birthday.birthdays, 'classes');
classes.forEach(function(classList){
classList.forEach(function(myClass){
if(!_.findWhere(Birthday.classes, {id :myClass[0] })){
Birthday.classes.push({
name: myClass[1],
id: myClass[0]
});
}
});
});
Birthday.currentClass = _.findWhere(Birthday.classes, { id: Birthday.currentClass.id })
if(!Birthday.currentClass){
Birthday.currentClass = Birthday.classes[0];
}
model.widgets.apply();
});
});
示例2: function
editMe: async function(params){
template.open('account/main', 'account/default-view');
directory.account = new directory.User({ id: model.me.userId, edit: { userbook: true, visibility: true } });
await init();
lang.addBundle('/auth/i18n', function () {
$scope.cguUrl = lang.translate("auth.charter");
});
if(model.me.type !== 'ELEVE'){
directory.account.edit.infos = true;
$scope.openView('user-edit', 'user');
}
else {
$scope.openView('user-view', 'user');
}
$scope.openView('userbook-edit', 'userbook');
}