incident-recording.component.ts 757 B

123456789101112131415161718192021222324252627282930
  1. import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
  2. @Component({
  3. selector: 'app-incident-recording',
  4. templateUrl: './incident-recording.component.html',
  5. styleUrls: ['./incident-recording.component.less']
  6. })
  7. export class IncidentRecordingComponent implements OnInit {
  8. @Output() closeModelHs = new EventEmitter<any>();//1.组件暴露一个 EventEmitter 属性,当事件发生时,子组件利用该属性 emits(向上弹射)事件
  9. @Input() path: any;
  10. constructor() { }
  11. audioPath = ""; //录音文件地址
  12. ngOnInit() {
  13. this.audioPath = location.origin + this.path;
  14. }
  15. // 关闭弹窗
  16. hideModal() {
  17. this.closeModelHs.emit(JSON.stringify({ show: false }));//emits(向上弹射)事件
  18. }
  19. }