changeset 8:a50a4e814ff3

Track div for the waves-ui track.
author Lucas Thompson <dev@lucas.im>
date Wed, 26 Oct 2016 17:26:31 +0100
parents f5e2fa766ddf
children 1fcc8c9ec54c
files src/app/waveform/waveform.component.html src/app/waveform/waveform.component.ts
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/app/waveform/waveform.component.html	Wed Oct 26 17:18:42 2016 +0100
+++ b/src/app/waveform/waveform.component.html	Wed Oct 26 17:26:31 2016 +0100
@@ -1,3 +1,1 @@
-<p>
-  waveform works!
-</p>
+<div #track></div>
--- a/src/app/waveform/waveform.component.ts	Wed Oct 26 17:18:42 2016 +0100
+++ b/src/app/waveform/waveform.component.ts	Wed Oct 26 17:26:31 2016 +0100
@@ -1,4 +1,5 @@
-import { Component, OnInit } from '@angular/core';
+import {Component, OnInit, ViewChild, ElementRef} from '@angular/core';
+
 declare var wavesUI: any;
 
 @Component({
@@ -7,11 +8,13 @@
   styleUrls: ['./waveform.component.css']
 })
 export class WaveformComponent implements OnInit {
+  @ViewChild('track') trackDiv: ElementRef;
 
   constructor() {
     console.log(wavesUI.core);
   }
 
   ngOnInit() {
+    console.log(this.trackDiv.nativeElement.getBoundingClientRect().width);
   }
 }