1
我试图让每个iteration.my代码项目的总人数是这个我如何获得项目总的NG-重复
<ul class="phones">
<li ng-repeat="phone in phones | filter:query | orderBy:orderProp"
ng-init="index()" class="thumbnail">
<a href="#/phones/{{phone.id}}" class="thumb">
<img ng-src="{{phone.imageUrl}}">
</a>
<a href="#/phones/{{phone.id}}">{{phone.name}}</a>
<p>{{phone.snippet}}</p>
</li>
</ul>
<div>
{{ total }}
</div>
控制器
phonecatApp.controller('PhoneListCtrl', function($scope, $http)
{
$scope.total =0;
$scope.index =function()
{
$scope.total ++;
}
}
不完全是,我想的时候NG-重复重复了“总”(值),动态的数量。 – 2014-09-20 20:44:56