Open xduseko opened 8 years ago
This error occurs when angularPlayer service is used and soundManager directive exists on the page.
angularPlayer
soundManager
Example:
angularPlayer.addTrack
ng-click
ng-something
player:playlist
scope.$on('player:playlist', function(event, data) { scope.$apply(function() { scope.playlist = data; }); });
Note: We are still in $apply phase, because angular events are handled synchronously.
Error: [$rootScope:inprog] $apply already in progress
The plunker is here http://plnkr.co/edit/77Fy0oJpvRrPrmG1YRbR?p=preview.
Pull request https://github.com/perminder-klair/angular-soundmanager2/pull/43
I have the same problem, solved by xduseko's fix, thanks.
This error occurs when
angularPlayer
service is used andsoundManager
directive exists on the page.Example:
angularPlayer.addTrack
insideng-click
event handler. Note: Everyng-something
handler is executed in $apply phase by AngularJS.angularPlayer.addTrack
broadcastsplayer:playlist
event.Note: We are still in $apply phase, because angular events are handled synchronously.
The plunker is here http://plnkr.co/edit/77Fy0oJpvRrPrmG1YRbR?p=preview.