Mercurial > hg > ugly-duckling
comparison src/app/waveform/waveform.component.ts @ 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 | ee4353d1aeeb |
children | 0b24b8ae62f8 |
comparison
equal
deleted
inserted
replaced
7:f5e2fa766ddf | 8:a50a4e814ff3 |
---|---|
1 import { Component, OnInit } from '@angular/core'; | 1 import {Component, OnInit, ViewChild, ElementRef} from '@angular/core'; |
2 | |
2 declare var wavesUI: any; | 3 declare var wavesUI: any; |
3 | 4 |
4 @Component({ | 5 @Component({ |
5 selector: 'app-waveform', | 6 selector: 'app-waveform', |
6 templateUrl: './waveform.component.html', | 7 templateUrl: './waveform.component.html', |
7 styleUrls: ['./waveform.component.css'] | 8 styleUrls: ['./waveform.component.css'] |
8 }) | 9 }) |
9 export class WaveformComponent implements OnInit { | 10 export class WaveformComponent implements OnInit { |
11 @ViewChild('track') trackDiv: ElementRef; | |
10 | 12 |
11 constructor() { | 13 constructor() { |
12 console.log(wavesUI.core); | 14 console.log(wavesUI.core); |
13 } | 15 } |
14 | 16 |
15 ngOnInit() { | 17 ngOnInit() { |
18 console.log(this.trackDiv.nativeElement.getBoundingClientRect().width); | |
16 } | 19 } |
17 } | 20 } |