A better way is to use $compile
instead of ng-bind-html-unsafe
.
See: http://docs.angularjs.org/api/ng.$compile
Lastly, at the moment, the last version of angularJS (release candidate 1.2.0) do not have any ng-bind-html-unsafe
directive. So I really encourage you to consider this option before any future update of your app. ( ng-bind-html-unsafe
may/will not working any more...)
http://code.angularjs.org/1.2.0rc1/docs/api/ng.directive:ngBindHtml