# Pull to Refresh not working

**URL:** <https://forum.ionicframework.com/t/pull-to-refresh-not-working/17592>\
**Category:** ionic-v1\
**Created:** [February 13, 2015, 8:10pm UTC](https://forum.ionicframework.com/t/pull-to-refresh-not-working/17592 "2015-02-13T20:10:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maketroli](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/maketroli/32/72294_2.png) [@Maketroli](https://forum.ionicframework.com/u/Maketroli)\
**Post date:** [February 13, 2015, 8:10pm UTC](https://forum.ionicframework.com/t/pull-to-refresh-not-working/17592/1 "2015-02-13T20:10:35Z")

</div>

I am trying to use the Ionic’s [Pull to Refresh tool](http://ionicframework.com/docs/api/directive/ionRefresher/) for first time but still not working for me

this is a controller where I am calling a factory/service in order to have a list of sports in the view

```auto
    .controller('sportsCtrl', function($scope, SportsFactory, AuthFactory) {

     $scope.sports = [];

        AuthFactory.getCustomer().then(function(customer) {
          $scope.customer = customer;
          SportsFactory.getSportsWithLeagues(customer).then(function(sports) {
            if (sports.length) {
              $scope.sports = sports;
            }else {
              AuthFactory.logout();
            }
         //Here is the function to call the refresher//
            $scope.doRefresh = function() {
              $scope.sports = sports;
              $scope.$broadcast('scroll.refreshComplete');
              $scope.$apply();
            };
        //////////////////////////////////////////////
          }, function(err) {
            console.log(err);
          });
        }
    })

```

**HTML**

```auto
    <ion-refresher
      pulling-text="Pull to refresh..."
      on-refresh="doRefresh()">
    </ion-refresher>

```

does anyone has an idea ?

---

<div class="post-metadata">

**Author:** ![Maketroli](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/maketroli/32/72294_2.png) [@Maketroli](https://forum.ionicframework.com/u/Maketroli)\
**Post date:** [February 13, 2015, 10:12pm UTC](https://forum.ionicframework.com/t/pull-to-refresh-not-working/17592/2 "2015-02-13T22:12:42Z")

</div>

figured it out by myself. here is the answer just in case one of you need it any time

```auto
    .controller('sportsCtrl', function($scope, SportsFactory, AuthFactory) {

     $scope.sports = [];

     $scope.doRefresh = function() {
        AuthFactory.getCustomer().then(function(customer) {
          $scope.customer = customer;
          SportsFactory.getSportsWithLeagues(customer).then(function(sports) {
            if (sports.length) {
              $scope.sports = sports;
            }else {
              AuthFactory.logout();
            }
          }, function(err) {
            console.log(err);
          });
        }
        $scope.$broadcast('scroll.refreshComplete');
      }; 
     $scope.doRefresh 
   })

```
