Using the Pull To Refresh feature for release AFTER 0.9.26
A Pen by Justin Noel on CodePen.
<html ng-app="ionicApp"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"> | |
<title>Ionic Template</title> | |
<link href="http://code.ionicframework.com/nightly/css/ionic.min.css" rel="stylesheet"> | |
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.min.js"></script> | |
</head> | |
<body ng-controller="MyCtrl"> | |
<ion-header-bar title="myTitle"></ion-header-bar> | |
<ion-content has-header="true" padding="false"> | |
<ion-refresher | |
pulling-text="Pull to refresh..." | |
on-refresh="doRefresh()" | |
refreshing-icon="ion-loading-c" | |
> | |
</ion-refresher> | |
<ion-list> | |
<ion-item ng-repeat="item in items">{{item}}</ion-item> | |
</ion-list> | |
</ion-content> | |
</body> | |
</html> |
Using the Pull To Refresh feature for release AFTER 0.9.26
A Pen by Justin Noel on CodePen.
angular.module('ionicApp', ['ionic']) | |
.controller('MyCtrl', function($scope, $timeout) { | |
$scope.myTitle = 'Template'; | |
$scope.items = ['Item 1', 'Item 2', 'Item 3']; | |
$scope.doRefresh = function() { | |
console.log('Refreshing!'); | |
$timeout( function() { | |
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4); | |
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4); | |
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4); | |
$scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4); | |
//Stop the ion-refresher from spinning | |
$scope.$broadcast('scroll.refreshComplete'); | |
}, 1000); | |
}; | |
}); |
body { | |
cursor: url('http://ionicframework.com/img/finger.png'), auto; | |
} |