From 03218da30c97a2ac919a05deaaedb6a5953a5deb Mon Sep 17 00:00:00 2001 From: Andrew Joslin Date: Tue, 20 May 2014 10:54:15 -0600 Subject: [PATCH] demo(refresher): add basic demo --- js/angular/directive/refresher.js | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/js/angular/directive/refresher.js b/js/angular/directive/refresher.js index 99f0792adb..9f763a9371 100644 --- a/js/angular/directive/refresher.js +++ b/js/angular/directive/refresher.js @@ -57,6 +57,45 @@ * the refresher. * */ +/** + * @ngdoc demo + * @name ionRefresher#withAList + * @module refresherList + * @javascript + * angular.module('refresherList', ['ionic']) + * .controller('RefresherCtrl', function($scope, $timeout) { + * $scope.items = ['Item 1', 'Item 2', 'Item 3']; + * + * $scope.doRefresh = function() { + * $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); + * $scope.$broadcast('scroll.refreshComplete'); + * }, 1000); + * }; + * }); + * + * @html + * + *

Refresher

+ *
+ * + * + * + * + * + * + * + * {{item}} + * + * + * + */ IonicModule .directive('ionRefresher', ['$ionicBind', function($ionicBind) { return {