An open API service indexing awesome lists of open source software.

https://github.com/copaste/ng2-ynslider

Angular 4 Slider
https://github.com/copaste/ng2-ynslider

angular angular2 angular4 carousel slider

Last synced: about 2 months ago
JSON representation

Angular 4 Slider

Awesome Lists containing this project

README

          

# ng2-ynslider
Simple slider/carousel for your angular2 applications.
Does not depend of jquery.
Please star a project if you liked it, or create an issue if you have problems with it.

## Installation

1. Install npm module:

`npm install ng2-ynslider --save`

## Usage

Import `YnSliderModule` in your app.
There are two components you can use in your components.

First is a `yn-slider`:

```html




{{ img.description }}



```

* `autoplay` - Autoplay the slides
* `speed` - The speed of the autoplay in ms
* `initialSlide` - Start from specific slide
* `pager` - Show/Hide the dotted pager
* `(slideDidChange)` - event emitted when slide changed
* `options` - Additional options
## Sample

Using simple yn-slider:

```typescript
import { Component } from '@angular/core';
import { YnSliderModule } from 'ng2-ynslider';

@Component({
selector: "app",
template: `






{{img.description}}






`
})
export class App {
ynOpt = {
height: 360,
slidesToShow: 2,
slidesToScroll: 1,
autoPlay: true,
interval: 5000,
activeSlideIndex: 0,
partialMode: true,
};
}

@NgModule({
imports: [
// ... modules
YnSliderModule
],
declarations: [
App
],
bootstrap: [
App
]
})
export class AppModule {

}
```