An Angular directive wrapper for a lightweight library to detect swipes on touchscreen devices.
This library is an Angular directive wrapper around the vanilla JS swipe detection library ag-swipe-core.
For more details on the public interface of the library please see the Github page.
```
npm install ng-swipe --save
`typescript
import { SwipeModule } from 'ng-swipe';
@NgModule({
imports: [
SwipeModule
],
})
`
`typescript
import { SwipeEvent } from 'ng-swipe';
@Component({
selector: 'app',
template:
})
export class AppComponent {
onSwipeMove(event: SwipeEvent) {
console.log(SwipeMove direction: ${event.direction} and distance: ${event.distance});
}
onSwipeEnd(event: SwipeEvent) {
console.log(SwipeEnd direction: ${event.direction} and distance: ${event.distance});
}
}
``