ng2-bootstrap-base-modified
Version:
Native Angular Bootstrap Components Typeahead modified
69 lines (62 loc) • 2.02 kB
text/typescript
import {
AfterViewInit, Component, ChangeDetectionStrategy, Inject
} from '@angular/core';
import { TooltipConfig } from './tooltip.config';
import { isBs3 } from '../utils/ng2-bootstrap-config';
export class TooltipContainerComponent implements AfterViewInit {
public classMap: any;
public placement: string;
public popupClass: string;
public animation: boolean;
public get isBs3(): boolean {
return isBs3();
}
public constructor(config: TooltipConfig) {
Object.assign(this, config);
}
public ngAfterViewInit(): void {
this.classMap = {in: false, fade: false};
this.classMap[this.placement] = true;
this.classMap['tooltip-' + this.placement] = true;
this.classMap.in = true;
if (this.animation) {
this.classMap.fade = true;
}
if (this.popupClass) {
this.classMap[this.popupClass] = true;
}
}
}