Skip to content

Commit 03218da

Browse files
committed
demo(refresher): add basic demo
1 parent f21da07 commit 03218da

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

js/angular/directive/refresher.js

+39
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,45 @@
5757
* the refresher.
5858
*
5959
*/
60+
/**
61+
* @ngdoc demo
62+
* @name ionRefresher#withAList
63+
* @module refresherList
64+
* @javascript
65+
* angular.module('refresherList', ['ionic'])
66+
* .controller('RefresherCtrl', function($scope, $timeout) {
67+
* $scope.items = ['Item 1', 'Item 2', 'Item 3'];
68+
*
69+
* $scope.doRefresh = function() {
70+
* $timeout(function() {
71+
* $scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
72+
* $scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
73+
* $scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
74+
* $scope.items.push('New Item ' + Math.floor(Math.random() * 1000) + 4);
75+
* $scope.$broadcast('scroll.refreshComplete');
76+
* }, 1000);
77+
* };
78+
* });
79+
*
80+
* @html
81+
* <ion-header-bar class="bar-positive">
82+
* <h1 class="title">Refresher</h1>
83+
* </ion-header-bar>
84+
*
85+
* <ion-content ng-controller="RefresherCtrl">
86+
*
87+
* <ion-refresher on-refresh="doRefresh()"
88+
* pulling-text="Pull to refresh..."
89+
* refreshing-text="Refreshing!"
90+
* refreshing-icon="ion-loading-c">
91+
* </ion-refresher>
92+
*
93+
* <ion-list>
94+
* <ion-item ng-repeat="item in items">{{item}}</ion-item>
95+
* </ion-list>
96+
*
97+
* </ion-content>
98+
*/
6099
IonicModule
61100
.directive('ionRefresher', ['$ionicBind', function($ionicBind) {
62101
return {

0 commit comments

Comments
 (0)