I have a html value inside my scope, i need to append it inside a div, how do i do that?
Example:
$scope.htmlValue = '<p> text text <\p>';
Html :
<div> {{ htmlValue }} <\div>
Thanks !!
I have a html value inside my scope, i need to append it inside a div, how do i do that?
Example:
$scope.htmlValue = '<p> text text <\p>';
Html :
<div> {{ htmlValue }} <\div>
Thanks !!
You are not using AngularJS correctly. If you need to modify the HTML, you should probably be in a directive.
That being said, you need to tell angular ahead of time what can be trusted as html and then you can use the ng-bind-html directive to bind to html. You will need to use $sce.trustAsHtml(). Related post.
What you probably need is $sanitize service. take a look here https://docs.angularjs.org/api/ngSanitize/service/$sanitize
However, as has been already meantioned, it is very likely you are not using angularJS in expected way.