# angular-glide

A lightweight image carousel built for angular.

[![CircleCI](https://circleci.com/gh/andrewangelle/angular-glide.svg?style=shield)](https://circleci.com/gh/andrewangelle/angular-glide) [![See Demo](https://img.shields.io/badge/see-demo-8D52AB.svg)](https://u21334841.dl.dropboxusercontent.com/u/21334841/demos/angular-glide/index.html)

<a href="https://u21334841.dl.dropboxusercontent.com/u/21334841/demos/angular-glide/index.html"><img src="https://i.ytimg.com/vi/Bi7srVEHJ0w/maxresdefault.jpg" width="400px" /></a>

## 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

```sh
$ npm install angular-glide
```

## Usage

Pass in your images for the carousel in the controller

```javascript
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
```html
<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

| option      | type      | description                           |
|------------ |-----------|---------------------------------------|
|`images`     |array      | the images to be displayed by component |
|`infinite`   |bool    | carousel loops infinitely. Defaults to true |
|`autoplay`   |bool    | carousel will auto-rotate slides. Defaults to false |
|`autoplayspeed`|int  | The 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](http://localhost:8080):

```
$ npm start
```

Run tests and watch for code changes using [karma](https://karma-runner.github.io):

```
$ npm test
```

Lint `src` and `test` files:

```
$ npm run lint
```

## License

MIT
