ng2-bootstrap-base-modified
Version:
Native Angular Bootstrap Components Typeahead modified
41 lines (32 loc) • 1.13 kB
text/typescript
import { Component, HostBinding, OnDestroy, Input, OnInit } from '@angular/core';
import { CarouselComponent } from './carousel.component';
export class SlideComponent implements OnInit, OnDestroy {
/** Is current slide active */
public active:boolean;
/** Wraps element by appropriate CSS classes */
public addClass:boolean = true;
/** Link to Parent(container-collection) component */
protected carousel:CarouselComponent;
public constructor(carousel:CarouselComponent) {
this.carousel = carousel;
}
/** Fires changes in container collection after adding a new slide instance */
public ngOnInit():void {
this.carousel.addSlide(this);
}
/** Fires changes in container collection after removing of this slide instance */
public ngOnDestroy():void {
this.carousel.removeSlide(this);
}
}