The code is as follows
<input type='text' ng-model='cdkey.name'> {{cdkey.name}}
The input box of ngModel displays the data correctly, but the data is not displayed in the double brackets on the right. What is the reason for this?
Additional: ng-bind can also be displayed correctly, but double curly braces cannot. Is the rendering method of ngBind and double curly braces different? ? ?
1. If
input
里面的ng-model
绑定的数据模型不是一个Object
, then this should not happen.2.
ng-bind
和{{}}
The results of rendering data are different when the data model to which they are bound is an object.3. I wrote a demo, you can have a look.
The value of the input tag should of course be placed in the attribute valuel.