对于未来世界中的所有人,答案是将 .perPage(undefined) 添加到字段定义中,然后在 restangularConfiguration 中处理它,并完全删除分页:
nga.field('CompanyId', 'reference')
.label('Company')
.targetEntity(companies)
.perPage(undefined)
.targetField(nga.field('Name'))
.validation({required: true})
RestangularProvider.addFullRequestInterceptor(
(element, operation, what, url, headers, params, httpConfig) => {
// PAGINATION
if (params._page != undefined && params._perPage != undefined) {
params.$skip = (params._page - 1) * params._perPage;
params.$top = params._perPage;
}
else{
delete params.$skip;
delete params.$top;
}
delete params._page;
delete params._perPage;