angular-owl-carousel
Dependencies
This Library requires jquery to be installed globally
For commonJs based application load jquery using script loader or use link tag in html file
Install script-loader if you don't have already
npm install script-loader
and in vendor.ts
;
OR
If using angular-cli
Add this to angular cli-json file
"scripts":
Installation
To install this library, run:
$ npm install angular-owl-carousel --save
and then from your Angular AppModule
:
;; ; // Import your library;
Once your library is imported, you can use OwlCarousel component very easily in your Angular application:
<!-- You can use owl-carousel selector to include its component --> [items]="images" <!-- classes to be attached along with owl-carousel class --> [carouselClasses]="['owl-theme', 'row', 'sliding']">
APIs
- next(options?: any[])
To go to next slide. Animation time can be passed as options array. E.g. this.owlElement.next([200]). (200ms animation time).
- previous(options?: any[])
To go to previous slide. (arguments are similar)
- to(options?: any[])
To go to nth slide. (arguments are similar)
- trigger(action: string, options?: any[])
To trigger any jquery owl carousel's action. options can be passed accordingly.
- refresh()
After doing some changes in owl component's options this function can be used to refresh owl component
;
License
This project is licensed under the terms of the MIT license.