AngularJS : service $broadcast and $watch not triggering on receiving controller

后端 未结 4 1988
感动是毒
感动是毒 2021-02-02 10:19

AngularJS noob here, on my path to the Angular Enlightenment :)

Here\'s the situation:

I have implemented a service \'AudioPlayer\' inside my module \'app\' and

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 10:40

    When you have a click event the $scope is updated, without the event you'll need to use $apply

    $scope.$apply(function () {
        $scope.current = track;
    });
    

提交回复
热议问题