UNPKG

ng2-bootstrap-base-modified

Version:

Native Angular Bootstrap Components Typeahead modified

30 lines (25 loc) 719 B
import { Component } from '@angular/core'; @Component({ selector: 'demo-carousel-dynamic', templateUrl: './dynamic.html' }) export class DemoCarouselDynamicComponent { public myInterval: number = 1500; public slides: any[] = []; public activeSlideIndex: number; public noWrapSlides:boolean = false; public constructor() { for (let i = 0; i < 4; i++) { this.addSlide(); } } public addSlide(): void { this.slides.push({ image: `assets/images/nature/${ this.slides.length % 8 + 1 }.jpg` }); } public removeSlide(index?: number): void { const toRemove = index ? index : this.activeSlideIndex; this.slides.splice(toRemove, 1); } }