Попытка вставить HTML-контент на страницу с помощью ng bind, как показано ниже, но не может связать его.
Сценарий:
SS_Mod_App.controller("SS_Ctrl",/*"$interpolate",*/ function ($scope, $http, $location, $window, $sce/*, $interpolate*/) {
$scope.dates = getWeekDates(); //alert(dates); Result: 3/30,3/31, ......
$scope.divHtmlVar = $sce.trustAsHtml(' <table class="GeneratedTable"> < tbody > <tr> <td rowspan="2">Cases</td> <td rowspan="2">Total</td> <td colspan="3">Mon</td>{{ dates[0] }} <td colspan="3">Tue</td>{{ dates[1] }} <td colspan="3">Wed</td> {{ dates[2] }} <td colspan="3">Thu</td> {{ dates[3] }} <td colspan="3">Fri</td> {{ dates[4] }} <td colspan="3">Sat</td> {{ dates[5] }} <td colspan="3">Sun</td>{{ dates[6] }} </tr> </tbody > </table >');
});
HTML-страница:
<body>
<div ng-app="SS_ng_App" ng-controller="SS_Ctrl">
<div ng-bind-html="divHtmlVar"></div>
</div>
</body>
невозможно связать их в HTML {{date [0]}} {{date [1]}} ...
Результат на странице:
< tbody > {{ dates[0] }} {{ dates[1] }} {{ dates[2] }} {{ dates[3] }} {{ dates[4] }} {{ dates[5] }} {{ dates[6] }}
Cases Total Mon Tue Wed Thu Fri Sat Sun