cannam@473: /**
cannam@473: * Created by lucas on 01/06/2017.
cannam@473: */
cannam@473: import {VerticalBinNameRenderer} from './waves-base.component';
cannam@473: import {
cannam@473: ChangeDetectionStrategy,
cannam@473: Component,
cannam@473: ContentChildren,
cannam@473: QueryList,
cannam@473: AfterViewInit
cannam@473: } from '@angular/core';
cannam@473:
cannam@473: @Component({
cannam@473: selector: 'ugly-vertical-binned',
cannam@473: template: '',
cannam@473: changeDetection: ChangeDetectionStrategy.OnPush
cannam@473: })
cannam@473: export class VerticalBinnedComponent implements AfterViewInit {
cannam@473:
cannam@473: @ContentChildren(
cannam@473: VerticalBinNameRenderer
cannam@473: ) bounded: QueryList;
cannam@473: protected cachedBinNames: string[];
cannam@473:
cannam@473: ngAfterViewInit(): void {
cannam@473: this.bounded.forEach(component => {
cannam@473: this.cachedBinNames = component.binNames;
cannam@473: if (this.cachedBinNames) {
cannam@473: component.renderNames(this.cachedBinNames);
cannam@473: }
cannam@473: });
cannam@473: }
cannam@473: }