How to create angularjs filter which outputs HTML

后端 未结 3 1119
庸人自扰
庸人自扰 2020-12-13 01:14

After reading AngularJS tutorial step-9 I have created my own AngularJS filter, which should convert boolean data into html.

Here is my filter code:

         


        
3条回答
  •  Happy的楠姐
    2020-12-13 01:55

    You should use the ng-bind-html directive (require to import the sanitize module and js file): https://docs.angularjs.org/api/ng/directive/ngBindHtml

    
    

    You also need to import the CSS (Bootstrap I guess) to be able to see the icon when it works.

    I have provided a working example.

提交回复
热议问题