【发布时间】:2017-02-17 19:52:52
【问题描述】:
现在可以了……
我在输入中获取数组并粘贴名称,然后在输入中更改名称并将其放入。
HTML
<form id="edit">
<table>
<tr>
<th>Name: </th>
<td>
<input id="name" form="edit" type="text" ng-model="name" required>
</td>
</tr>
</table>
<button ng-click="edit()">Submit</button>
</form>
AngularJS
$scope.display = function()
{
var connection = $http(
{
method: 'GET',
url: 'http://localhost:8080/students?id=' + $scope.id
})
.then(function(response)
{
$scope.myArray = response.data;
$scope.name = $scope.myArray[0].name;
})
【问题讨论】:
-
使用angular时不需要type submit!
-
“提交失败”实际上是什么意思?您在这里使用的是
ng-click,它与input没有任何关系。
标签: angularjs forms html-table