With ng-bind-html-unsafe removed, how do I inject HTML?

后端 未结 10 2009
不思量自难忘°
不思量自难忘° 2020-11-22 04:06

I\'m trying to use $sanitize provider and the ng-bind-htm-unsafe directive to allow my controller to inject HTML into a DIV.

However, I can

10条回答
  •  时光说笑
    2020-11-22 04:39

    You do not need to use {{ }} inside of ng-bind-html-unsafe:

    Here's an example: http://plnkr.co/edit/R7JmGIo4xcJoBc1v4iki?p=preview

    The {{ }} operator is essentially just a shorthand for ng-bind, so what you were trying amounts to a binding inside a binding, which doesn't work.

提交回复
热议问题