0
Я пытаюсь получить доступ к таможенной службы от пользовательского события еще wheneven событие обжигали ссылки на службу является нулевымДоступ к таможенной службы от события
@Component({
selector: "my-component",
template: mySource,
legacy: { transclude: true }
})
export class myComponent {
constructor(
@Inject("$scope") private $scope: ng.IScope,
private myService: MyService) {
$scope.$on('$routeChangeSuccess', function (event) {
this.myService.myFunction();
});
}
});
}
когда MYSERVICE ссылается следующее сообщение об ошибке показано ниже:
Cannot read property 'myService' of null