Directive that wraps nolimits4web/swiper library for AngularJS. License: Apache
bower install angular-swiper
npm install -g gulp npm install bower install
<script>s to your
html files for angular and angular-swiper:
ksSwiper as a dependency for your app:
3.2 Sample Markup
3.3 Directive default values
If no attributes are given, an object with the following values will be used to initiate the swiper. It is possible to use the directive without specifying attributes.
// directive defaultsvar params =slidesPerView: $scopeslidesPerView || 1slidesPerColumn: $scopeslidesPerColumn || 1spaceBetween: $scopespaceBetween || 0direction: $scopedirection || 'horizontal'loop: $scopeloop || falseinitialSlide: $scopeinitialSlide || 0showNavButtons: false;
3.4 Possible Attributes
The following attributes can be used with this directive. Please see the Swiper API Documentation for more information about the type and description of parameters.
3.5 Override any parameter
3.6 Two-Way Binding of Swiper
In some situations it might be useful to access the actual swiper instance. Passing the parent scope will linked it to the model in the directive's isolated scope which is used for the swiper instance.
It can also be used to slideTo(index, speed, runCallbacks), slidePrev(runCallbacks, speed), slideNext(runCallbacks, speed) or for callback functions.
3.7 Accessing swiper object after it's created
In some situations, like when you wanna listen to swiper events, is useful to know when the swiper object is created (that occurs after all slides are created).
For that purpose is available the on-ready attribute. You can specify a function to be called when the swiper object is created. In the function you can manipulate the swiperobject, and for example, bind an event. The function must has a paramteter called swiper, refering to swiper object.