angular.js ng-repeat li items with html content

前端 未结 7 1722
挽巷
挽巷 2020-12-13 18:34

I have a model that comes back from the server which contains html instead of text (for instance a b tag or an i tag)
when I use ng-repeat to built a list out of it i

相关标签:
7条回答
  • 2020-12-13 19:19

    use ng-bind-html-unsafe

    it will apply html with text inside like below:

        <li ng-repeat=" opt in opts" ng-bind-html-unsafe="opt.text" >
            {{ opt.text }}
        </li>
    
    0 讨论(0)
提交回复
热议问题