Just add html tags to text apparently not works well. I believe thats its to only add 'text' not elements. Maybe I'm doing something wrong.
Follows plunker. With two cases. One of official documentation and other with answers posted here.
(function(angular) {
'use strict';
angular.module('bindHtmlExample', ['ngSanitize'])
.controller('ExampleController', ['$scope', function($scope) {
$scope.myHTML =
'I am an <code>HTML</code>string with ' +
'<a href="#">links!</a> and other <em>stuff</em>';
$scope.executar = function(){
var myEl = angular.element(document.querySelector('#divData'));
myEl.text('<b>This is a bold text</b>');
};
}]);
})(window.angular);
https://plnkr.co/edit/1Hnb018XstMYfynr34nJ?p=preview
Advice of Sebastian Sebald its good. Go ahead documentation.
I also did not know until five minutes ago. I just learn now.