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