Skip to content

Saunalol/angular-pull-to-refresh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngPullToRefresh is a directive providing a simple css-only pull-to-refresh component leveraging native style momentum scrolling -webkit-overflow-scroll: touch.

The directive has a configurable built-in debounce system (400ms treshold by default) and can leverage angular $q promises.

Examples

Demo

<div class="content" pull-to-refresh="refresh()">
</div>
angular.module('myApp')

  .controller('NetworkCtrl', function($scope, User) {

    $scope.users = User.query().$promise;

    $scope.refresh = function() {
      return User.query().$promise;
    };

Quick start

  • Install the module with bower
$ bower install angular-pull-to-refresh --save
  • Include the required libraries:
<link rel="stylesheet" href="components/angular-pull-to-refresh/dist/pull-to-refresh.css">
<script src="components/angular-pull-to-refresh/dist/pull-to-refresh.js"></script>
  • Inject the mgcrea.pullToRefresh module into your app:
var app = angular.module('myApp', ['mgcrea.pullToRefresh']);

Contributing

Please submit all pull requests the against master branch. If your unit test contains JavaScript patches or features, you should include relevant unit tests. Thanks!

Authors

Olivier Louvignes

Copyright and license

The MIT License

Copyright (c) 2013 Olivier Louvignes

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

About

CSS3 Pull-to-Refresh directive for AngularJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published