title: Play sound on button click (Angular)
body: <p>I'm trying to play a sound when a link is clicked</p>
  
  <p>This is what I have, however, it doesn't work and seems to slow the browser down significantly whenever I have it added into the files</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a routerLinkActive="active" routerLink="/tomato2" class="tomato" (click)="playAudio()"&gt;
    &lt;img class="tomato_1" src="https://freepngimage.com/content/uploads/images/tomato-7866.png" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>TS:</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { Http } from '@angular/http';
  
  @Component({
    selector: 'home',
    templateUrl: './catalog.component.html'
  })
  
  export class CatalogViewComponent {
      playAudio(){
        let audio = new Audio();
        audio.src = "http://www.schillmania.com/projects/soundmanager2/demo/mpc/audio/CHINA_1.mp3";
        audio.load();
        audio.play();
        this.playAudio();
      }
  }
  </code></pre>