I have a $scope variable like so:
$scope.example = "<h1>Hello</h1>"
When I output this in my view {{example}}
, I want the HTML rendered. At the moment it outputs:
<h1>Hello</h1>
rather than
Is what I am trying to achieve possible?
It should be
$scope.html = "<h1>Hello</h1>";
and
<div ng-bind-html-unsafe="html"></div>
Also see this, AngularJS : Insert HTML into view
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With