shamon shamsudeen
shamon shamsudeen

Reputation: 5848

Ionic refresher not working properly

I am developing android app using Ionic framework. I used a <ion-refresher> tag to load the contents dynamically when the user pulls down the page. But it didn't work.

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

My controller code is blow:

$scope.doRefresh = function() {
              $http.get('http://localhost/test/gksfapp_backend.php?action=an').then(function(msg){
                     //never executed.
                     $scope.items=msg.data;
                     })
                     .finally(function() {
                     // Stop the ion-refresher from spinning
                         $scope.$broadcast('scroll.refreshComplete');
               });

How can I make this work?

Upvotes: 2

Views: 2149

Answers (1)

Onosa
Onosa

Reputation: 1273

I believe you have simply forgotten the parenthesis after doRefresh

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

Also, here is a working code example. http://codepen.io/ionic/pen/mqolp

Upvotes: 3

Related Questions