1.2.0 • Published 4 years ago
@boxslider/angular v1.2.0
BoxSlider Angular ===
Angular directives for the BoxSlider content slider.
Installation
npm install --save @boxslider/slider @boxslider/angularUsage
Import the module for the slider you wish to use into your application module.
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
FadeSliderModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }Add the directive to your slider HTML in the template.
<div class="viewport">
<div class="slider" bxlFadeSlider
[activeSlide]="activeSlide"
[autoScroll]="autoScroll"
(beforeSlide)="handleBeforeSlide($event)"
(afterSlide)="handleAfterSlide($event)">
<div class="slide">One</div>
<div class="slide">Two</div>
<div class="slide">Three</div>
<div class="slide">Four</div>
<div class="slide">Five</div>
<div class="slide">Six</div>
<div class="slide">Seven</div>
<div class="slide">Eight</div>
</div>
</div>Inputs
sliderOptions: BoxSliderOptionsSee the BoxSlider documentation for the available options but note that there is no need to provide theeffectoption.effectOptions: EffectOptionsThe options for the effect in use. See the effect option documentation for detailed information.activeSlide: numberuse this input to control the visible slide at a zero based index. For instance setting this to 2 will show slide number 3.autoScroll: booleanuse this input to control if the slider is playing or paused.
Outputs
beforeSlide: EventDataEmits on the BoxSliderbeforeevent.afterSlide: EventDataEmits on the BoxSliderafterevent.played: voidEmits on the BoxSliderplayevent.paused: voidEmits on the BoxSliderpausedevent.destroyed: voidEmits on the BoxSliderdestroyevent when the component is destroyed during its lifecycle.