Update ionicContent.js

Changed the javascript example for ion-refresher.  Moved the call to stop the spinning into a finally block.
This commit is contained in:
Keith D. Moore
2014-03-27 14:46:09 -05:00
parent a93e178989
commit 3b79a8a3bf

View File

@@ -186,11 +186,14 @@ function($timeout, $controller, $ionicBind) {
* .controller('MyController', function($scope, $http) {
* $scope.items = [1,2,3];
* $scope.doRefresh = function() {
* $http.get('/new-items').success(function(newItems) {
* $scope.items = newItems;
* //Stop the ion-refresher from spinning
* $scope.$broadcast('scroll.refreshComplete');
* });
* $http.get('/new-items')
* .success(function(newItems) {
* $scope.items = newItems;
* })
* .finally(function() {
* // Stop the ion-refresher from spinning
* $scope.$broadcast('scroll.refreshComplete');
* });
* };
* });
* ```