A photo/image carousel/slider/swiper for Angular that uses Hammer.JS.
Inspired by a great blog post from Drew Powers.
Online demo: https://stackblitz.com/edit/ngx-hammerjs-carousel-demo
npm install hammerjs ngx-hammerjs-carousel --save
In your (app) module:
import { HammerjsCarouselModule } from 'ngx-hammerjs-carousel';
...
@NgModule({
...
imports: [
...
HammerjsCarouselModule
...
],
In your TypeScript:
slides = [
'https://dummyimage.com/600x400x/000/fff',
'https://dummyimage.com/601x401x/000/fff',
'https://dummyimage.com/602x402x/000/fff',
'https://dummyimage.com/603x403x/000/fff',
'https://dummyimage.com/604x404x/000/fff',
];
In your template:
<hammerjs-carousel [slides]="slides"></hammerjs-carousel>
- Run
npm run build-watch
to build the library and watch for changes. - Run
npm run start
to start a dev server with an example app that uses the library.
- Up the version in projects/ngx-hammerjs-carousel/package.json
- Run
npm run build-publish
to build the project for publishing to npm. - Go to the /dist/ngx-hammerjs-carousel folder
- Run
npm publish