ng-swiper

1.0.9 • Public • Published

Angular-Swiper-Directive

Angular 1 directive to make easy the use of swiper.
This small npm package was created motivate for the problems using directly swiper with ng-repeat as can be found in stackoverflow.

You can see a working example on Plunker: Plunker example

Requirements

Angularjs v1.3+

Installation

npm install ng-swiper --save

How to use it

The directive can be used like this:

var app = angular.module('ngSwiperExample', ['ngSwiper']);

Then add something like this in your controller:

$scope.slides = [
       {image : "https://raw.githubusercontent.com/oscarandreu/ng-swiper/master/examples/example_1/img/slider1.jpg"},
       {image : "https://raw.githubusercontent.com/oscarandreu/ng-swiper/master/examples/example_1/img/slider2.jpg"}
   ]   

And use the directive in your view:

<ng-swiper 
    elements="slides"
    on-slide-change-start ="slideChange"
    speed: "1000",
    centeredSlides: "true",
    autoplay: "5000",
    autoplayDisableOnInteraction: "true",
    slidesPerView: "1",
    paginationClickable: "true",
    effect: "fade",
    loop: 'true'
    >
</ng-swiper>

Use examples

In the examples folder you can find several examples

example_1:

Ready to go simple use example.

example_2:

Webpack 2 / ES6 example than can be checked using nodejs executing the next commands.

Package Sidebar

Install

npm i ng-swiper

Weekly Downloads

4

Version

1.0.9

License

ISC

Last publish

Collaborators

  • oscarandreu