UNPKG

gian-ngx-tiny-slider

Version:

Angular component that gives you possibility to use tiny-slider library.

26 lines (21 loc) 520 B
import {ElementRef, Injectable} from '@angular/core'; import {tns} from 'gian-tiny-slider/src/tiny-slider'; @Injectable({ providedIn: 'root' }) export class GianNgxTinySliderService { constructor() { } initSlider(config, elementRef: ElementRef) { const extendConfig = Object.assign({container: elementRef.nativeElement}, config); return tns(extendConfig); } getDefaultConfig() { return { items: 3, mode: 'carousel', controlsPosition: 'bottom', speed: 400 }; } }