I have been trying to dynamically bind a CSS class using an AngularJS function. While the functionality is working properly, I keep encountering numerous errors in the browser console. Can anyone offer assistance with this issue? I have included my code and a screenshot below.
<tr ng-repeat-start="inventory in inventoryDetails.HotelFareInventoryAllotmentDetails">
<td rowspan="2">{{inventory.HotelRoomCategoryName}}</td>
<td>Inventory</td>
<td ng-class="getClassName(1)">{{inventory.D1.Inventory}}</td>
<td ng-class="getClassName(2)">{{inventory.D2.Inventory}}</td>
<td ng-class="getClassName(3)">{{inventory.D3.Inventory}}</td>
{{inventory.D31.Inventory}}</td>
</tr>
<tr ng-repeat-end>
<td>CutOff</td>
<td ng-class="{{getClassName(1}})">{{inventory.D1.Cutoff}}</td>
<td ng-class="getClassName(2)">{{inventory.D2.Cutoff}}</td>
<td ng-class="getClassName(3)">{{inventory.D3.Cutoff}}</td>
</tr>
$scopeChild.getClassName = function (dayID) {
var dayIndex = parseInt(dayID) - 1;
if ($scopeChild.Days[dayIndex].IsWeekend) {
return 'weekend';
}
else {
return '';
}
}