Pull to refresh doesn't work with ionic-nav-view?


#1

Where should I put the refresher tags? I’m using ionic-nav-view.

It says Place it as the first child of your ionContent but I don’t need any ionContent.

My working code

<ion-nav-view animation="slide-left-right"></ion-nav-view>

 <script id="home.html" type="text/ng-template">
<ion-view name="home">
<ul class="list">
//more stuff here..
       </ul>
    </ion-view>
  </script>

#2

You should be adding ionContent inside of your ionView. The ionContent is what wraps everything under the header, whereas the ionView is the entire page. You pretty much answered your question, the ionRefresher docs show an example where it is the first child of ionContent.

Edit: Here’s a working codepen of it.


#3
<script id="home.html" type="text/ng-template">
<ion-view name="home">
 <ionic-content>
 <ion-refresher
    pulling-text="Pull to refresh..."
    on-refresh="doRefresh()">
  </ion-refresher>
<ul class="list">
//more stuff here..
       </ul>
            </ionic-content>

    </ion-view>
  </script>

like this? I got an error saying Controller ‘$ionicScroll’, required by directive ‘ionRefresher’, can’t be found!


#4

Just edited my above comment to include a working example. The Ionic directives start with “ion” not “ionic”. Changing that should fix it but refer to my example if not. :smile:


#5

aw thanks! how careless am I… thanks man!


#6

You’re welcome :smile: