本文整理汇总了TypeScript中jQuery.when函数的典型用法代码示例。如果您正苦于以下问题:TypeScript when函数的具体用法?TypeScript when怎么用?TypeScript when使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了when函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configure
/**
* {@inheritdoc}
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('channel').fetchAll()
.then((scopes: InterfaceNormalizedChannel[]) => {
this.config.choices = scopes;
})
);
}
示例2: configure
/**
* {@inheritdoc}
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('locale').fetchActivated()
.then((availableLocales: InterfaceNormalizedLocale[]) => {
this.config.choices = availableLocales;
})
);
}
示例3: configure
/**
* {@inheritdoc}
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('user-role').fetchAll()
.then((userRoles: InterfaceNormalizedUserRole[]) => {
this.config.choices = userRoles;
})
);
}
示例4: configure
/**
* {@inheritdoc}
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('category').fetchAll()
.then((categories: InterfaceNormalizedCategory[]) => {
this.config.choices = categories;
})
);
}
示例5: configure
/**
* {@inheritdoc}
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('datagrid-view').fetchAll({ alias: this.config.datagridAlias })
.then((datagridViews: InterfaceNormalizedDatagridView[]) => {
this.config.choices = datagridViews;
})
);
}
示例6: configure
/**
* {@inheritdoc}
*
* Get all the user groups but the default one
*/
configure() {
return $.when(
BaseSelect.prototype.configure.apply(this, arguments),
FetcherRegistry.getFetcher('user-group').fetchAll()
.then((userGroups: InterfaceNormalizedUserGroup[]) => {
this.config.choices = userGroups.filter((userGroup) => {
return userGroup.meta.default !== true;
});
})
);
}
示例7: renderForm
renderForm() {
return $.when(
FormBuilder.build('pim-catalog-volume-index'),
$.get(Routing.generate('pim_volume_monitoring_get_volumes'))
).then((form: BaseView, data = []) => {
this.on('pim:controller:can-leave', (event: {canLeave: true}) => {
form.trigger('pim_enrich:form:can-leave', event);
});
form.setData(data[0]);
form.setElement(this.$el).render();
return form;
});
}