0
我是angualar js和ionic的新手,在我的開發過程中,我遇到了一個我不知道的錯誤。它告訴我在腳本中有一個重複的名字。錯誤:[ngRepeat:dupes]重複在repeater
.config(function($stateProvider, $urlRouterProvider){
$stateProvider
.state('tabs',{
url: '/tab',
abstract:true,
templateUrl:'templates/tabs.html'
})
.state('tabs.source',{
url:'/source',
views:{
'list-source':{
templateUrl: 'templates/source.html',
controller: 'feedsctrl'
}
}
})
.state('tabs.keeps',{
url:'/keeps',
views:{
'list-keeps':{
templateUrl: 'templates/keeps/keeps.html',
controller: 'keepsctrl'
}
}
})
.controller('keepsctrl',['$scope','$http',function($scope,$http){
$http.get('http://localhost/vivalooks/app_ion/templates/keeps/keeps.php').success(function(data){
$scope.keeps=data ;
});
}]);
keeps.php導致
[{"fname":"Benjamin","lname":"Blay","pic":"4r4545.jpg ","fav_id":"4","wardrobe":null,"fav_total":"1"}]
下面
是keep.html腳本
<ion-header-bar class="bar-positive">
<button class="icon ion-home button button-clear"></button>
<h1 class="title">vivalooks</h1>
<button class="icon ion-person button button-clear"></button>
</ion-header-bar>
<div class="bar bar-subheader item-input-inset bar-light">
<label class="item-input-wrapper">
<i class="icon ion-search placeholder-icon"></i>
<input type="search" placeholder="Search">
</label>
</div>
<ion-view>
<ion-content class="has-subheader">
<ion-list class="list-inset" ng-repeat="items in keeps">
<ion-item class="item-text-wrap">
<div class="thumbnails_v"> <img ng-src="http://localhost/vivalooks/resize_image/vivalooks.php?image={{item.pic}}&new_width=300&new_height=300"">
</div>
<p>
{{item.fname}} {{item.lname}}
</p>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
您是否正在循環(ng-repeat)保留模板中的$ scope.keeps?如果可能的話發佈ng-repeat html和保持數據的結構。基本上,這意味着您在保留數據中有重複的項目(根據角度)。 – Umair
顯示代碼的html部分。 –
@HamletHakobyan,我已經編輯了問題並顯示了部分html – neiza