javascript - AngularJS: Insert HTML into View from string preserving style attributes -
i'm trying insert html code string
angular view, style attributes being removed html
in controller:
$scope.htmlstring = '<div style="height:40px;"></div><div style="height:40px;"></div><div style="height:40px;"></div>'
view:
<div ng-bind-html="htmlstring"></div>
the result i'm getting html without style attributes.
<div></div><div></div><div></div>
i have tried using ng-bind-html-unsafe
directive no success.
i appreciate help.
see fidddle
$scope.str = $sce.trustashtml(html); <div ng-bind-html="str"></div>
Comments
Post a Comment