Mercurial > hg > ugly-duckling
view src/app/audio-file-open/audio-file-open.component.ts @ 505:cf4a17efb5d4
Update angular deps, fix material api changes. (currently running an earlier TypeScript version due to restrictions from angular)
author | Lucas Thompson <dev@lucas.im> |
---|---|
date | Thu, 12 Oct 2017 13:12:33 +0100 |
parents | 53ea6406d601 |
children |
line wrap: on
line source
import { Component, OnInit, ViewChild, ElementRef, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'ugly-audio-file-open', templateUrl: './audio-file-open.component.html', styleUrls: ['./audio-file-open.component.css'] }) export class AudioFileOpenComponent implements OnInit { @ViewChild('open') open: ElementRef; @Output() fileOpened: EventEmitter<File>; constructor() { this.fileOpened = new EventEmitter<File>(); } ngOnInit() { } decodeAudio(files: FileList) { if (files.length > 0) { this.fileOpened.emit(files[0]); } } openAudioDialog() { this.open.nativeElement.click(); } }