我的HTML如何从ngRepeat中的文本输入中获取项目编号?
<body ng-app="myApp" ng-controller="myCTRL">
<form class="my-form" ng-repeat="item in items" novalidate>
<h4>{{item.number}}</h4>
<input type="text" ng-model="item.hed"><br>
<input type="text" ng-model="item.subhed">
</form>
</body>
我的JS:
var app= angular.module("myApp",[]);
app.controller("myCTRL",function($scope,$http){
$scope.items= [
{
number: chartNumber,
hed: '',
subhed: ''
}
];
});
当我输入一些东西到input
标签,我想console.log()
的item.number
值。我如何使用AngularJS v1.6.1做到这一点?
*当我输入一些东西到'input'标签,我想'的console.log()''的值item.number' *什么? ? –