view src/app/audio-file-open/audio-file-open.component.ts @ 509:041468f553e1 tip master

Merge pull request #57 from LucasThompson/fix/session-stack-max-call-stack Fix accidental recursion in PersistentStack
author Lucas Thompson <LucasThompson@users.noreply.github.com>
date Mon, 27 Nov 2017 11:04:30 +0000
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();
  }
}