ng-bind-html removes style

북마크 추가

ng-bind-html 사용시

 

inline style 태그가 사라질 때 해결방법

 

 

1. 컨트롤러에 $sce 추가

 

~~~~~($scope, $sce)

 

 

2. 사용방법

 

html :

<div ng-bind-html = "test">

</div>

 

controller :

 

$scope.test = $sce.trustAsHtml(htmlString);

 

해주면

 

inline stlye tag가 지워지지 않고 적용됨

 

 

 

AD
관리자
2014-10-23 11:49
SHARE