Commit 7569cac3604441504fa278021e555d0a93b91f39

Authored by Marcelo Puebla
1 parent 83dfaec486
Exists in develop

Add

Sonido al agregarse una nueva comanda.
src/app/modules/comanda/comanda.component.ts
... ... @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
2 2 import { IComanda, IComandaDetalle, IComponente } from 'src/app/interfaces/IComanda';
3 3 import { ComandaService } from 'src/app/services/comanda/comanda.service';
4 4 import * as _ from 'lodash';
  5 +import { SoundManager } from 'src/app/utils/sound-manager';
5 6  
6 7 @Component({
7 8 selector: 'app-comanda',
... ... @@ -47,6 +48,7 @@ export class ComandaComponent implements OnInit {
47 48 }
48 49 }
49 50 if (!resComandas.length) return;
  51 + SoundManager.playAudio('beep-01a.wav');
50 52 Array.prototype.push.apply(this.comandas, resComandas);
51 53 this.startTimersPedido(resComandas);
52 54 }
src/app/utils/sound-manager.ts
... ... @@ -0,0 +1,8 @@
  1 +export class SoundManager {
  2 + public static playAudio(audioName: string) {
  3 + let audio = new Audio();
  4 + audio.src = `assets/sounds/${audioName}`;
  5 + audio.load();
  6 + audio.play();
  7 + }
  8 +}
0 9 \ No newline at end of file
src/assets/sounds/beep-01a.wav
No preview for this file type