是否可以调用从列的renderWith()函数中返回promise的服务/过滤器?我正在尝试这样做,输出始终是“[object Object]”。
vm.dtInstance = {};
vm.dtOptions = DTOptionsBuilder.fromFnPromise(MyService.getData())
.withPaginationType('full_numbers')
.withOption('rowCallback', casesDtRowCallback)
.withBootstrap()
.withOption('createdRow', createdRow)
.withOption('scrollX', true)
.withOption('scrollY', false);
vm.dtColumns = [
DTColumnBuilder.newColumn(null)
.withTitle('ID')
.renderWith(idHtml),
DTColumnBuilder.newColumn(null)
.withTitle('Status')
.renderWith(statusHtml),
];
function caseStatusHtml(data, type, full, meta) {
return $filter('myCustomFilter')(data.theStatus).then(function(response) {
// myCustomFilter returns a string
return response;
})
}