The problem is caused when you try to apply a text bind in html mode, i.e. ng-bind-html
without the use of the module ngSanitize
, which is responsible for 'lapidar', shall we say, this text for the same is displayed.
There are some "fixes" that you create a directive to circumvent this error so that you apply the bind
"unsafe" mode. But the most correct way would be to initialize the module ngSanitize
Angular itself in its application. It is a common boot like any other module.
//Inclua o script como achar melhor, ex.:
<script src="//ajax.googleapis.com/ajax/libs/angularjs/X.Y.Z/angular-sanitize.js"></script>
and in your module do the boot:
angular.module('app', [
//Seus outros módulos aqui
'ngSanitize'
]);
Edited
How these options (and our talk in the comments) did not solve the problem - which is very strange - this one would be the alternative fix I mentioned:
angular.module('gaxApp')
.filter('trust_html', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
Being used thus:
ng-bind-html="seucampo | trust_html"
You’re wearing something like that
ng-bind-html=...
in your project?– celsomtrindade
I have an excerpt that I use yes, I was reading now that this may give error, if that is the case what the best way to use it?
– Diogo Soares