Guest User

Untitled

a guest
Apr 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. 'use strict';
  2. var app = angular.module('myApp');
  3.  
  4. app.controller('carsIndexCtrl', function ($scope, $sce) {
  5.  
  6. $scope.model = 'cars';
  7.  
  8. $scope.fields = [{
  9. name: 'Name',
  10. column: 'name',
  11. custom_html: '',
  12. }, {
  13. name: 'Description',
  14. column: 'description',
  15. custom_html: '',
  16. }, {
  17. name: 'Edit',
  18. column: '',
  19. custom_html: '<a href="/cars/edit/{{item.id}}"><i class="fas fa-edit"></i></a>',
  20. }];
  21. });
  22.  
  23. <tr ng-repeat="item in items track by item.id">
  24. <td ng-repeat="field in fields track by field.column">
  25. <span ng-if="field.column !== ''">{{item[field.column]}}</span>
  26. <span ng-if="field.column === ''" ng-bind-html="field.custom_html"></span>
  27. </td>
  28. </tr>
Add Comment
Please, Sign In to add comment