view src/app/notebook-feed/notebook-feed.component.ts @ 236:53ea6406d601

Generate new project with latest @angular/cli, including Angular 4.
author Lucas Thompson <dev@lucas.im>
date Tue, 25 Apr 2017 20:01:09 +0100
parents 77ada2e07997
children 5ab9e6132424
line wrap: on
line source
/**
 * Created by lucast on 21/03/2017.
 */
import {
  ChangeDetectionStrategy,
  Component,
  Input
} from '@angular/core';
import Waves from 'waves-ui';
import {AnalysisItem} from '../analysis-item/analysis-item.component';

@Component({
  selector: 'ugly-notebook-feed',
  templateUrl: './notebook-feed.component.html',
  styleUrls: ['./notebook-feed.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class NotebookFeedComponent {
  sharedTimeline: Timeline;
  @Input() analyses: AnalysisItem[];
  @Input() set rootAudioUri(uri: string) {
    this._rootAudioUri = uri;

    // TODO is this safe? will the fact references are held elsewhere
    // keep the previous instance alive? Or will it get garbage collected in
    // screw previous layers up?
    this.sharedTimeline = new Waves.core.Timeline();
  }

  get rootAudioUri(): string {
    return this._rootAudioUri;
  }
  private _rootAudioUri: string;

  constructor() {
    this.sharedTimeline = new Waves.core.Timeline();
  }
}