的下面是我的模板代碼:消毒劑無法解析HTML以下塊:<br style="margin: 0px; padding: 0px;"/>
<div ng-bind-html="product.qtxx"></div>
但我得到的錯誤,也許是因爲在JSON數據中包含像「<br style=\"margin: 0px; padding: 0px;\"/>
」 HTML代碼,和離子拋出錯誤:
Error: [$sanitize:badparse] The sanitizer was unable to parse the following block of html: <br style=\"margin: 0px; padding: 0px;\"/>blabla
我並不能解決這個問題,也許是因爲雙引號""
在html影響json語法? 可以解決這個問題嗎?
我認爲這可以幫助你http://stackoverflow.com/questions/22533491/angularjs-how-can-i-ignore-certain-html-tags –