Hi, I used the ionic refresher to update a json file.
Everything works fine, but the first second or so, all objects are appearing 2 times.
After a second or so, it just shows the array fine.
Here’s my code:
app.controller('tableController', function ($scope, $http) {
$scope.getData = function (jsonstring) {
$http.get(jsonstring).then(function (res) {
$scope.data = res.data;
$scope.$broadcast('scroll.refreshComplete');
});
};
$scope.getData('*somejson*');
$scope.refreshData = function () {
$scope.getData(*someotherjson*);
};
});
And my view:
<ion-view title="My app'" left-buttons="leftButtons">
<ion-content has-header="true" padding="true" on-refresh="refreshData()">
<ion-refresher></ion-refresher>
<div class="list">
<ion-item ng-repeat="user in data" item="item">
<div class="row">
<div class="col">{{user.id}}</div>
</div>
</ion-item>
</div>
</ion-content>
</ion-view>
Any help ? Thanks in advance.