AngularJS - Ng-Table will not parse headers

Using an Ng table, I tried to create one table view that could be controlled from AngularJS options.

To control the title text, I need to put it in the data header or ng-data-title (Example: data-title = "'Test'")

But he always makes an empty table title. enter image description here

Instead of filling: enter image description here

Code snippet:

<td ng-repeat="v in tableSettings.data" data-title="v.name">
    {{v.data?v.data(row):row[v.id]}}
</td>

Full code:

<table ng-table="table" class="table" show-filter="{{tableSettings.filter}}">
    <tr ng-repeat="row in $data">
        <td ng-repeat="v in tableSettings.data" ng-click="tableSettings.click(row)" ng-attr-data-title="'{{v.name}}'"
            ng-if="v.type!='switch'"
            sortable="'{{sortable?sortable:v.id}}'">
            {{v.data?v.data(row):row[v.id]}}
        </td>
    </tr>
</table

When I try to parse Angular into it, I just get errors: (click to see errors)

"'{{v.name}}'"         "{{v.name}}"

Is there a way to fix this or even parse it manually from AngularJS?

+4
source share
1

, , data-title ( ), data-title="'My first column'" , ng-table-dynamic.

:

<table ng-table-dynamic="tableParams with cols" show-filter="true" class="table table-bordered table-striped">
  <tr ng-repeat="row in $data track by row.id">
    <td ng-repeat="col in $columns">{{::row[col.field]}}</td>
  </tr>
</table>

, tablePrams with cols. cols - $scope, .

$scope.cols =  [
    { title: 'ID', field: 'id', filter: { id : 'text' }, show: true, sortable: 'id' }, 
    { title: 'Installation', field: 'installationAt' },
    ...
];

, filter, show, sortable .

+4

Source: https://habr.com/ru/post/1617491/


All Articles