【发布时间】:2015-02-11 04:51:06
【问题描述】:
我想从 JSON 对象中设置公式的输入文本字段,这是选择选项的值。我在 AngularJS 控制器中有一个数据,选择组合框后,数据已更改,但未填充文本字段。 https://github.com/lijunwu001/jstree_with_select.git 这是github上的演示链接。
【问题讨论】:
-
请输入一些代码
-
到目前为止你尝试了什么?
-
<select ng-model='vm.selected' required> <option ng-repeat="node in vm.treeData" value='{{ node }}'>{{ node.text }}</option> </select>节点是 {id:1, text: text}<div ng-repeat='node in vm.selected'> ID: <input type='text' ng-attr-value='{{ node["id"] }}' /> Description: <input type='text' ng-attr-value='{{ node["text"] }}' size='35'/><br /> </div>这是文本字段 -
我刚刚在 git 上创建了存储库:github.com/lijunwu001/jstree_with_select.git
标签: angularjs forms text input