Для этого вам понадобится директива ng-style
, например:
<tr ng-repeat="x in response">
<td>{{x.property1}}</td>
<td>{{x.property2}}</td>
<td ng-style="{'background-color': x.color1}">{{x.property3}}</td>
<td ng-style="{'background-color': x.color2}">{{x.property4}}</td>
</tr>
DEMO:
var app = angular.module('app', []);
app.controller('tableController', function($scope) {
$scope.response = [{
property1: 'Jill',
property2: 'Smith',
color1: 'red',
color2: 'green'
},
{
property1: 'John',
property2: 'Doe',
color1: 'yellow',
color2: '#336699'
},
];
});
table, td {
border: 1px solid black;
border-collapse: collapse;
}
td {padding: 10px; min-width:120px;}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<table ng-controller="tableController" ng-app="app">
<tr ng-repeat="x in response">
<td ng-style="{'background-color': x.color1}">{{x.property1}}</td>
<td ng-style="{'background-color': x.color2}">{{x.property2}}</td>
</tr>
</table>