Refresh an ionic list items


#1

Hey ,

I have a timeline in my app and I’m asking for the way to refresh it periodically ?

Any help or suggestion ?


#2

Angular has a wonder $interval service which you could use.

// Your Ctrl

angular.module('your-app')

.controller('YourCtrl', function($scope, $interval){

	// Refresh every 1 second
	var refreshTimer = 1000;

	$interval(function(){
		$scope.doMyRefresh();
	}, refreshTimer);

	$scope.doMyRefresh = function() {
		console.log('REFRESHING :)');
	};

});

Hope this helps!


#3

thank you , I’m gonna try it