angular.js - How does ng-model bind a variable-named property of an object?
PHP中文网
PHP中文网 2017-05-15 17:07:41
0
1
599

<input ng-model="node.varname">
node is an object on the scope, var is a varname on the scope, I want to bind the input box to the name on the
node On the attribute that is the value of varname: for example, if varname="car"; it is bound to node.car and solved

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
某草草

ng-model="node[varname]"

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template