ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.09k stars 13.51k forks source link

Has no method refreshComplete; #247

Closed iamlasse closed 10 years ago

iamlasse commented 10 years ago

What am I doing wrong?

View

<content has-header="true" has-tabs="true" on-refresh="refreshContent()" scroll="true" refresh-complete="refreshComplete">
        <refresher></refresher>
        <list>
          <link-item ng-repeat="pet in pets" type="item-text-wrap" href="#/pet/{{pet.id}}">
              <h3>{{pet.title}}</h3>
              <p>{{pet.description}}</p>
            </item>
          </link-item>
        </list> 
      </content>

COntroller

 $scope.$on('scroll.onRefreshComplete', function(){
    $log.log(' content refreshed');  
    $scope.refreshComplete();
  });

  $scope.refreshContent = function(){
    $timeout(function(){
      $log.log('refresh content');  
      $scope.$broadcast('scroll.onRefreshComplete');
    }, 1000);
  }

Also... I am so lost in the manuals nothing makes sense, It may just be me or your tutorials are super confusing. I cant find any real hierarchy in where to put things, panes nav-bars etc. When I use the nav-bar directive there is no place to put a side-menu toggle button, it only accepts a back button... is there an example that has page nav as well as a side menu? Grateful for answer I'm so lost now lol...

mlynch commented 10 years ago

Hey @iamlasse. I am going to be pushing some changes to scrolling tonight or tomorrow that do away with refreshComplete, so just be patient for a sec and this will be much easier to work with.

Totally agree on the tutorials. Unfortunately, a lot has changed quickly so we need to go back and update stuff and start to solidify the docs. Part of the 'alpha' phase I guess :)

Let me know if you have any problems with particular ones, and I'd love to have you file an issue on the site repo: https://github.com/driftyco/ionic-site/issues/new

iamlasse commented 10 years ago

Oh wow that was fast lol Thank you! Ok I was trying to just get a basic app going with some basic elements like a header bar with variable buttons, like menu on the home page and back buttons on sub pages, with no avail, the nav-bar directive didnt allow for (in my understanding) left-buttons and the header-bar isnt dynamic and just keeps the same buttons on all pages. Thank you for confirming abot the tutorials I though I was going bonkers here...

mlynch commented 10 years ago

Hey @iamlasse. Try pulling from master. Now, the way to do this is to trigger an event to notify the scroll system that your refresh is completed:

$scope.$broadcast('scroll.refreshComplete');

See the tabs example to see what I mean: https://github.com/driftyco/ionic/blob/master/js/ext/angular/test/tabs.html

ionitron-bot[bot] commented 6 years ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.