嗨我正在Angularjs Datatables和嘗試使用ng-repeat迭代列和行,但它不工作。我檢查了文檔,但無法找到在html上傳遞列和記錄的確切方式。AngularJs Datatables無法迭代html上的列使用ng重複
function CustomElementCtrl(DTOptionsBuilder, DTColumnBuilder) {
var vm = this;
vm.dtOptions = DTOptionsBuilder.fromSource('data.json')
.withDOM('<"custom-element">pitrfl');
vm.dtColumns = [
DTColumnBuilder.newColumn('id').withTitle('ID'),
DTColumnBuilder.newColumn('firstName').withTitle('First name'),
DTColumnBuilder.newColumn('lastName').withTitle('Last name').notVisible()
];
}
Here the dtColumns are manually created and the dtOptions are directly assigned from json, but I want to assign columns also from json.
And why I can't use ng-repeat on html to iterate both columns and rows
rather then like this <table datatable="" dt-options="showCase.dtOptions" dt-columns="showCase.dtColumns" class="row-border hover">
感謝,
您在哪裏使用過ng-repeat?你在哪裏分配數據到範圍? –
@KishoreBarik像 <表數據表= 「」 類= 「行邊界懸停」> HTML {{柱}}