2

Does anyone know how to do a pull to refresh in a mobile site?

I can see some conflicting issues that could be found from trying to implement this such as Chrome already does this from the browser by default and trying to compensate for Safari rubberbanding/overscrolling on iOS which is extremely annoying.

The project I am currently working on already has Kendo UI and Mobile Angular Frameworks so I don't really want to suggest adding Ionic on top of everything just to get pull to refresh functionality added.

Since I am using Mobile Angular Framework, I thought I should mention that it wouldn't be a full page reload, but a $stateProvider reload if possible, if not it will have to be a full page reload.

Thanks in advance!

EDIT: Just to add to the above, I tried out the mgcrea angular pull to refresh but this didn't work for android chrome and people have also been saying on other posts that the guy who originally built it has abandoned the project.

ChronixPsyc
  • 478
  • 1
  • 8
  • 22

2 Answers2

0

There is some libraries besides ionic to help with this: https://github.com/mgcrea/angular-pull-to-refresh for instance.

Blake
  • 641
  • 6
  • 12
  • I probably should have mentioned that I looked at that one, but the issue is that it hasn't been updated in about two years and there's comments on the internet that the guy who originally built it has abandoned the library. I'll update my original post to add this in. – ChronixPsyc Oct 15 '15 at 13:17
  • What about this one? http://cubiq.org/dropbox/iscroll4/examples/pull-to-refresh/ You could just use jquery to solve the issue. Angular already comes with jqlite, you can just add jquery to allow use of this library. – Blake Oct 15 '15 at 14:35
  • That's great! I just tested the demo on Android and iOS devices and it works like a charm so I'll give this a go. Thanks a lot! – ChronixPsyc Oct 15 '15 at 15:56
  • That library doesn't even load the files from bower when following the github instructions, I get an angular injector error – Adam Diament Dec 17 '16 at 19:58
0

Here's one that seems to work pretty well, and is a bit newer than some of the other ones out there:

https://github.com/scsenge/pull-to-refresh

Amrit Kahlon
  • 1,286
  • 1
  • 18
  • 38