angularjs-3rd-party

ng-bind-html vs bind-html-compile?

人走茶凉 提交于 2019-12-08 22:31:24
问题 I want to know the difference between ng-bind-html and bind-html-compile directives. For example I gave <p style='color:red'>test<p> to ng-bind-html, this strips out the style where as bind-html-compile does not. May I know when each directive should be used. Thanks. 回答1: bind-html-compile is not a standard Angular directive, it comes with the module https://github.com/incuna/angular-bind-html-compile and it is used to compile binded data.To make it simple, it is equivalent to write html in