import 'twbs/carousel';

export class CarouselController {

  public carouselElement: any;

  constructor(
    public $element
  ) {}

  public initCarousel(): void {
    this.carouselElement = this.$element.find('.carousel');
    this.carouselElement.carousel({
      interval: false
    });
  }

  public carouselPrev(): void {
    this.carouselElement.carousel('prev');
  }

  public carouselNext(): void {
    this.carouselElement.carousel('next');
  }

  $onInit() {
    this.initCarousel();
  }
}
