diff src/app/app.component.ts @ 19:953932e9ba82

Remove zone injection from app.component and move to where the event is emitted in audio-file-open.component.
author Lucas Thompson <dev@lucas.im>
date Fri, 28 Oct 2016 08:28:54 +0100
parents ff964b28a272
children 3e96bcbfa5c5
line wrap: on
line diff
--- a/src/app/app.component.ts	Thu Oct 27 17:48:23 2016 +0100
+++ b/src/app/app.component.ts	Fri Oct 28 08:28:54 2016 +0100
@@ -1,4 +1,4 @@
-import {Component, Inject, NgZone} from '@angular/core';
+import {Component, Inject} from '@angular/core';
 import {MailService} from "./mail.service";
 
 @Component({
@@ -14,8 +14,7 @@
 
   constructor(
     private mail: MailService,
-    @Inject('piper-server-uri') private serverUri,
-    private zone: NgZone
+    @Inject('piper-server-uri') private serverUri
   ) {}
 
   onUpdate(id, text) {
@@ -23,10 +22,8 @@
   }
 
   onAudioLoaded(buffer: AudioBuffer) {
-    this.zone.run(() => { // TODO why the f does this only recognise changes immediately (and not the next tick) inside zone.run?
-      this.audioBuffer = buffer;
-      this.count++;
-    });
+    this.audioBuffer = buffer;
+    this.count++;
   }
 
   testRef() {