输入我演示:angularjs保持在NG-重复
http://jsfiddle.net/LQGE2/525/
的想法是,只要一个NG重复更新项目相关的输入数据被删除。当ng重复项目被更改时,如何让输入不被删除?
function AlbumCtrl($scope,$timeout) {
var a = 5
var counters = [a, 100, 999];
$scope.counters = counters
$scope.plusOne = function (i) {
counters[i] = counters[i] + 1
$scope.counters = counters
}
}
<html ng-app>
<body>
<div ng-controller="AlbumCtrl">
<div ng-repeat="(key, value) in counters" ng-click="plusOne(key)">
{{value}}
<button>plusone</button>
<input/>
</div>
</div>
</body>
</html>
感谢那么糟糕。 – Harry