Mercurial > hg > ugly-duckling
view src/app/visualisations/vertical-binned.component.ts @ 486:c9f12a9c1d5c
Actually find the corresponding analysis instead of assuming its at the front.
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Mon, 03 Jul 2017 20:34:59 +0100 |
parents | de23ea6bcd0d |
children |
line wrap: on
line source
/** * Created by lucas on 01/06/2017. */ import {VerticalBinNameRenderer} from './waves-base.component'; import { ChangeDetectionStrategy, Component, ContentChildren, QueryList, AfterViewInit } from '@angular/core'; @Component({ selector: 'ugly-vertical-binned', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush }) export class VerticalBinnedComponent implements AfterViewInit { @ContentChildren( VerticalBinNameRenderer ) bounded: QueryList<VerticalBinNameRenderer>; protected cachedBinNames: string[]; ngAfterViewInit(): void { this.bounded.forEach(component => { this.cachedBinNames = component.binNames; if (this.cachedBinNames) { component.renderNames(this.cachedBinNames); } }); } }