ngx-tiny-slider
v1.0.2
Published
Angular component that gives you possibility to use tiny-slider library.
Downloads
660
Maintainers
Readme
ngx-tiny-slider
Angular component that gives you possibility to use tiny slider library.
- Demo page
How to use
- npm i ngx-tiny-slider
- Import NgxTinySliderModule into your shared / root module
- Use in your component template use
Sandboxes
- Custom controls codesandbox.io
Whats new on 1.0.2?
- Added lazy loading example
- Added domReady into NgxTinySliderInstanceInterface
Usage example
Your module definition example
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {NgxTinySliderModule} from 'ngx-tiny-slider';
@NgModule({
imports: [
BrowserModule,
NgxTinySliderModule
],
declarations: [
AppComponent
],
exports: [
NgxTinySliderModule
],
providers: [],
bootstrap: [
AppComponent
]
})
export class AppModule {
}
Your component definition example
import {Component, OnInit} from '@angular/core';
import {NgxTinySliderSettingsInterface} from 'ngx-tiny-slider';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
tinySliderConfig: NgxTinySliderSettingsInterface;
ngOnInit() {
this.tinySliderConfig = {
arrowKeys: true,
autoWidth: true,
gutter: 10,
controlsText: ['<', '>']
};
}
}
Your component template example
<ngx-tiny-slider [config]="tinySliderConfig">
<ng-container class="items">
<div class="item">
<a target="_blank" href="google.com">
<img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
</a>
</div>
<div class="item">
<a target="_blank" href="google.com">
<img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
</a>
</div>
<div class="item">
<a target="_blank" href="google.com">
<img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
</a>
</div>
<div class="item">
<a target="_blank" href="google.com">
<img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
</a>
</div>
<div class="item">
<a target="_blank" href="google.com">
<img src="http://www.mattsorger.com/newsletterpics/gsw07_01.jpg">
</a>
</div>
</ng-container>
</ngx-tiny-slider>
Additional options
- domReady {Subject} - provide possibility to initialize component manually