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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -