1.1.0 • Published 7 years ago

angular-glide v1.1.0

Weekly downloads
8
License
-
Repository
-
Last release
7 years ago

angular-glide

A lightweight image carousel built for angular.

CircleCI See Demo

Features

  • Includes webpack-dev-server for ease of use in development
  • Built in tests with Karma
  • See projects example folder for more detailed usage.

Installation

$ npm install angular-glide

Usage

Pass in your images for the carousel in the controller

import "angular-glide";

angular
  .module("example", ["ngGlide"])
  .controller("someController", $scope => {
    $scope.images = [
      "http://image1.jpg",
      "http://image2.jpg",
      "http://image3.jpg"
    ];
  });

Add the module into your template

<div ng-controller="someController">
  <ng-glide 
    images="images" 
    infinite="true" 
    autoplay="false" 
    autoplayspeed="2000" />
</div>

Source the CSS styles located at lib/ng-glide.css.

Options

optiontypedescription
imagesarraythe images to be displayed by component
infiniteboolcarousel loops infinitely. Defaults to true
autoplayboolcarousel will auto-rotate slides. Defaults to false
autoplayspeedintThe rate of change of slides in autoplay mode. Defined in ms. Defaults to 2000ms

Development

Install dependencies:

$ npm install

Run the development server at http://localhost:8080:

$ npm start

Run tests and watch for code changes using karma:

$ npm test

Lint src and test files:

$ npm run lint

License

MIT