Using an API to obtain the url of the sound to play in audio tag
View
<img src="../img/play.svg" alt="Play" ng-click="playSound('exampleWord')" width="48"/>
Controller:
$scope.playSound=function(input){
$scope.audio={};
soundFetch.getSound(input).success(function(data){
$scope.audio=data;
});
}
The soundFetch is the service to call the getSound function. The returning data is the url of the song.
How can I play the sound after clicking the img tag. Currently getting an error Error: [$interpolate:interr]