https://github.com/alirezamirian/angular-material-swipe-to-refresh
Swipe to refresh (pull to refresh) for Angular Material
https://github.com/alirezamirian/angular-material-swipe-to-refresh
angular-material material-design pull-down-refresh pull-to-refresh
Last synced: about 1 month ago
JSON representation
Swipe to refresh (pull to refresh) for Angular Material
- Host: GitHub
- URL: https://github.com/alirezamirian/angular-material-swipe-to-refresh
- Owner: alirezamirian
- License: mit
- Created: 2016-11-28T21:47:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T08:53:30.000Z (almost 8 years ago)
- Last Synced: 2026-02-23T13:54:05.948Z (about 1 month ago)
- Topics: angular-material, material-design, pull-down-refresh, pull-to-refresh
- Language: JavaScript
- Homepage: https://alirezamirian.github.io/angular-material-swipe-to-refresh/
- Size: 36.1 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Angular Material Extensions - Swipe to refresh
Implementation of [material design swipe to refresh](https://material.google.com/patterns/swipe-to-refresh.html#swipe-to-refresh-positioning)
for [Angular Material](https://material.angularjs.org).
## Dependencies
- Angular Material
## Installation
```bash
bower install mde-swipe-to-refresh --save
```
## Usage
Add script and style:
```html
...
...
```
Add module dependency:
```js
angular.module("yourApp", ['mde.swipeToRefresh'])
```
Use it:
```html
```
By default scrolling element is assumed to be `body`. If it's not the case, you can specify it with one of the following
ways:
- `mde-scroll-host-selector` attribute:
```html
```
It will look up for the first ancestor that matches the selector.
- `mde-swipe-to-refresh-scroll-host` directive:
```html
```
### Options
- `mde-on-refresh`:
Optional expression to evaluate on refresh. If promise is returned, component will stay in spinning state until promise
is resolved or rejected.
- `mde-on-cancel`:
Optional expression to evaluate on cancel.
- `mde-scroll-host-selector`: String for determining scroll host from ancestors. It will be ignored if
`mde-swipe-to-refresh-scroll-host` directive is used.
- `mde-threshold`:
Threshold in pixels. Defaults to `mdeSwipeToRefreshConfig.threshold`
## TODO
- [ ] Improve demo
- [ ] fix bug when scroll host is not correctly set
- [ ] add arrow according to spec