changeset 405:3ace7672638b

Angular DI can't figure out these are derived from WavesComponent. Add provider for base.
author Lucas Thompson <dev@lucas.im>
date Sun, 04 Jun 2017 20:15:20 +0100
parents 6672496ff32e
children 0554b1af47f6
files src/app/visualisations/curve/curve.component.ts src/app/visualisations/grid/grid.component.ts src/app/visualisations/instants/instants.component.ts src/app/visualisations/notes/notes.component.ts src/app/visualisations/tracks/tracks.components.ts src/app/visualisations/waveform/waveform.component.ts
diffstat 6 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/visualisations/curve/curve.component.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/curve/curve.component.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -12,7 +12,8 @@
 import {
   VerticallyBounded,
   VerticalScaleRenderer,
-  VerticalValueInspectorRenderer
+  VerticalValueInspectorRenderer,
+  WavesComponent
 } from '../waves-base.component';
 import {TracksComponent} from '../tracks/tracks.components';
 
@@ -30,7 +31,8 @@
   providers: [
     {provide: VerticallyBounded, useExisting: CurveComponent },
     {provide: VerticalScaleRenderer, useExisting: CurveComponent},
-    {provide: VerticalValueInspectorRenderer, useExisting: CurveComponent}
+    {provide: VerticalValueInspectorRenderer, useExisting: CurveComponent},
+    {provide: WavesComponent, useExisting: CurveComponent}
   ]
 })
 export class CurveComponent implements VerticalValueInspectorRenderer {
--- a/src/app/visualisations/grid/grid.component.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/grid/grid.component.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -16,7 +16,10 @@
   selector: 'ugly-grid',
   templateUrl: '../waves-template.html',
   styleUrls: ['../waves-template.css'],
-  changeDetection: ChangeDetectionStrategy.OnPush
+  changeDetection: ChangeDetectionStrategy.OnPush,
+  providers: [
+    {provide: WavesComponent, useExisting: GridComponent}
+  ]
 })
 export class GridComponent extends WavesComponent<MatrixFeature> {
 
--- a/src/app/visualisations/instants/instants.component.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/instants/instants.component.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -14,7 +14,10 @@
   selector: 'ugly-instants',
   templateUrl: '../waves-template.html',
   styleUrls: ['../waves-template.css'],
-  changeDetection: ChangeDetectionStrategy.OnPush
+  changeDetection: ChangeDetectionStrategy.OnPush,
+  providers: [
+    {provide: WavesComponent, useExisting: InstantsComponent}
+  ]
 })
 export class InstantsComponent extends WavesComponent<Instant[]> {
   @Input() set instants(instants: Instant[]) {
--- a/src/app/visualisations/notes/notes.component.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/notes/notes.component.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -5,7 +5,8 @@
   InspectableVerticallyBoundedComponent,
   VerticallyBounded,
   VerticalScaleRenderer,
-  VerticalValueInspectorRenderer
+  VerticalValueInspectorRenderer,
+  WavesComponent
 } from '../waves-base.component';
 import {
   ChangeDetectionStrategy,
@@ -23,7 +24,8 @@
   providers: [
     { provide: VerticallyBounded, useExisting: NotesComponent },
     { provide: VerticalScaleRenderer, useExisting: NotesComponent },
-    {provide: VerticalValueInspectorRenderer, useExisting: NotesComponent }
+    {provide: VerticalValueInspectorRenderer, useExisting: NotesComponent },
+    {provide: WavesComponent, useExisting: NotesComponent}
   ]
 })
 export class NotesComponent extends InspectableVerticallyBoundedComponent<Note[]> {
--- a/src/app/visualisations/tracks/tracks.components.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/tracks/tracks.components.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -5,7 +5,7 @@
   InspectableVerticallyBoundedComponent,
   VerticallyBounded,
   VerticalScaleRenderer,
-  VerticalValueInspectorRenderer,
+  VerticalValueInspectorRenderer, WavesComponent,
 } from '../waves-base.component';
 import {
   ChangeDetectionStrategy,
@@ -25,6 +25,7 @@
     {provide: VerticallyBounded, useExisting: TracksComponent },
     {provide: VerticalScaleRenderer, useExisting: TracksComponent},
     {provide: VerticalValueInspectorRenderer, useExisting: TracksComponent},
+    {provide: WavesComponent, useExisting: TracksComponent}
   ],
 })
 export class TracksComponent
--- a/src/app/visualisations/waveform/waveform.component.ts	Sat Jun 03 09:59:56 2017 +0100
+++ b/src/app/visualisations/waveform/waveform.component.ts	Sun Jun 04 20:15:20 2017 +0100
@@ -11,7 +11,10 @@
   selector: 'ugly-waveform',
   templateUrl: '../waves-template.html',
   styleUrls: ['../waves-template.css'],
-  changeDetection: ChangeDetectionStrategy.OnPush
+  changeDetection: ChangeDetectionStrategy.OnPush,
+  providers: [
+    {provide: WavesComponent, useExisting: WaveformComponent}
+  ]
 })
 export class WaveformComponent extends WavesComponent<AudioBuffer> {
   @Input() set audioBuffer(buffer: AudioBuffer) {