Angularjs service callback to update scope of controller

后端 未结 4 756
[愿得一人]
[愿得一人] 2021-01-31 18:49

A service with a 3rd party library callback function:

mbAppModule.service(\'aService\', function ($http) {
    this.data={\"somedata\":0};
    var m3rdPartLib=\         


        
4条回答
  •  生来不讨喜
    2021-01-31 19:33

    Use $scope.$watch function. Look at my jsfiddle. I haven't your library, so I only simulate it - the value change from 0 to 1 after 5 seconds.

提交回复
热议问题