let services = new WeakMap;
class SomeController {
constructor(SomeService) {
services.set(this, SomeService);
}
get svcData(){
return services.get(this).getData();
}
}
angular.module('app').controller('SomeController', SomeController);
class SomeService {
constructor() {
}
getData(){
return [
...
...
]
}
}
angular.module('app').service('SomeService', SomeService);
var oldDigest = $scope.$digest;
$scope.$digest = function() {
console.log('digest fired');
oldDigest.call(this);
};