Angularjs 如何基于其他表单字段自动填充angular js中的文本字段

Angularjs 如何基于其他表单字段自动填充angular js中的文本字段,angularjs,hashmap,Angularjs,Hashmap,我举了一个学生场景作为例子。 假设在选择id时需要填充以下范围变量 $scope.student.name; $scope.student.address; $scope.student.city; $scope.student.zip; 下面是示例html <input type="text" ng-model="student.id"/> <input type="text" ng-model="student.name"/> <input type="tex

我举了一个学生场景作为例子。 假设在选择id时需要填充以下范围变量

$scope.student.name;
$scope.student.address;
$scope.student.city;
$scope.student.zip;
下面是示例html

<input type="text" ng-model="student.id"/>
<input type="text" ng-model="student.name"/>
<input type="text" ng-model="student.city"/>
<input type="text" ng-model="student.address"/>
<input type="text" ng-model="student.zip">

在常规jQuery中,我会编写更改和触发器。但我如何以一种角度实现这一点呢


我可能希望将整个db值放在一个hashmap的
中,并使用这个hashmap值填充到相应的字段中。

我知道回答这个问题可能有点晚了,但是我今天正在用Angular搜索自动填充的答案,发现可以使用
ng value
填充输入,并将其传递到
{}
中保存的值中

它看起来像这样:
ng value=“{{exampleValue}}


希望这有帮助。

如何选择id?您需要的应该是更改id。设置id输入,并使用函数更新模型值以填充其他字段。是否有此帮助?我不知道当学生数据来自散列图中的服务器时如何操作。请提供此信息。您能提供一个示例吗那个散列图是什么?