beeb
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<script src="http://code.angularjs.org/1.2.9/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.10.0/ui-bootstrap-tpls.min.js"></script>
<body ng-app="myApp">
<table class="table" ng-controller="ctrl">
<thead>
<tr><th>column</th></tr>
</thead>
<tbody>
<tr>
<td>
<span tooltip="that">this</span>
</td>
</tr>
<tr ng-repeat="foo in bar">
<td ng-bind-html="to_trusted(foo)"></td>
</tr>
</tbody>
</table>
</body>
JavaScript
var app = angular.module('myApp', ['ui.bootstrap']);
app.controller('ctrl', ['$scope', '$sce', function ($scope, $sce) {
$scope.bar = [];
// doing something async (exec time simulated by setTimeout)
myAsyncFunc(function (bar) {
$scope.bar = bar;
$scope.$apply(); // needed because of the timeout in the function
});
$scope.to_trusted = function (html_code) {
return $sce.trustAsHtml(html_code);
};
}]);
var myAsyncFunc = function (done) {
// simulate some kind of timeout due to processing of the function
setTimeout(function () {
return done(['<span tooltip="bar">foo</span>', '<span tooltip="I don\'t work">moo</span>']);
}, 500);
};