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 143 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
0
Ionic is a framework that allows you to build mobile applications using HTML, CSS, and JavaScript.1
How to check if the device is connected to the internet in Ionic1
Explain the benefits of using a ViewContainerRef in Ionic0
Ionic is a framework that uses AngularJS.1
Ionic is a front-end HTML5 framework.1
How to store data in Ionic1
Get the current position of the user in Ionic using the cordova plugin *cordova-plugin-geolocation*