Skip to content Skip to sidebar Skip to footer

Create A Table From Scope Object Values

I have a table which I'm trying to create from a scope-object that I'm creating in my controller. I would like the headers to take the value from 'rowHeader', which works fine. But

Solution 1:

There is a typo in the code cause the problem:

<tr ng-repeat="row in rows" border="1">
  <td ng-repeat="column in columns"
      ng-if="column.checked" ng-bind="row[column.cellValue]"></td>
</tr>

You don't have a scope variable called columns, change it to columnsTest.

<tr ng-repeat="row in rows" border="1">
  <td ng-repeat="column in columnsTest"
      ng-if="column.checked" ng-bind="row[column.cellValue]"></td>
</tr>

Post a Comment for "Create A Table From Scope Object Values"