Vik*_*hal 6 angularjs ng-bind-html
在内部ng-repeat
,以下代码不起作用:
<input type="text" ng-bind-html="row.value" />
Run Code Online (Sandbox Code Playgroud)
以下是:
<span ng-bind-html="row.value"></span>
Run Code Online (Sandbox Code Playgroud)
我猜ng-bind-html
是无法绑定到一个input
元素?
也没有ng-bind-html
实际的元素与模型绑定(在这里row.value
)
那是因为input
元素不能具有innerHTML内容.它使用value
attribute来设置输入值.
这与你试图写的一样.
<input type="text">
your value
</input>
Run Code Online (Sandbox Code Playgroud)
它不起作用,这不是angular.js错误.
归档时间: |
|
查看次数: |
4153 次 |
最近记录: |