I’m trying to implement on pull to refresh on the sample tabs app. The only thing I changed is to pull data from remote JSON. See the services.js here:
angular.module('starter.services', [])
/**
* A simple example service that returns some data.
* http://10.10.1.1/index.php/example/friends
*/
.factory('Friends', function($http) {
var friends = [];
$http.get('http://10.10.1.1/index.php/example/friends')
.success(function(data, status, headers,config){
console.log('data success');
console.log(data); // object seems fine
})
.error(function(data, status, headers,config){
console.log('data error');
})
.then(function(result){
friends = result.data;
});
return {
all: function() {
console.log('return');
console.log(friends);
return friends;
},
get: function(friendId) {
// Simple index lookup
return friends[friendId];
}
}
});
I have read the http://ionicframework.com/docs/api/directive/ionRefresher/ and now I just don’t get where exactly and how I should put all.
Thanks!