Hard
Here is the code for a view of our Ionic application :
<ion-content ng-controller="MyController">
<ion-list>
<ion-item ng-repeat="item in items">
{{item}}
</ion-item>
</ion-list>
<ion-infinite-scroll on-infinite="loadItems()" icon="ion-loading-c"></ion-infinite-scroll>
</ion-content>
function MyController($scope, $http) {
$scope.items = [];
$scope.loadItems = function () {
$http.get('/items').then(function (items) {
items.forEach(function (item) {
$scope.items.push(item);
});
});
};
$scope.$on('$stateChangeSuccess', function () {
$scope.loadItems();
});
}
What will happen ?
Author: Benjamin CanacStatus: PublishedQuestion passed 129 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
Similar QuestionsMore questions about Ionic