Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- var app = angular.module('myApp');
- app.controller('carsIndexCtrl', function ($scope, $sce) {
- $scope.model = 'cars';
- $scope.fields = [{
- name: 'Name',
- column: 'name',
- custom_html: '',
- }, {
- name: 'Description',
- column: 'description',
- custom_html: '',
- }, {
- name: 'Edit',
- column: '',
- custom_html: '<a href="/cars/edit/{{item.id}}"><i class="fas fa-edit"></i></a>',
- }];
- });
- <tr ng-repeat="item in items track by item.id">
- <td ng-repeat="field in fields track by field.column">
- <span ng-if="field.column !== ''">{{item[field.column]}}</span>
- <span ng-if="field.column === ''" ng-bind-html="field.custom_html"></span>
- </td>
- </tr>
Add Comment
Please, Sign In to add comment