Hi Szabo,
Ah yes, the onError gets evaluated before angular runs, Create a small
directive to set the onnerror, and handle it there.
Here is a sample plunk <http://plnkr.co/edit/FYNUNUT1OBCDCsYyQAUj?p=preview>
function myError() {
return {
restrict: 'A',
controller: myErrorController,
conntrollerAs: 'myError',
bindToController: {
'myError': '&'
}
}
function myErrorController($element, $scope) {
this.$onInit = () => {
$element[0].addEventListener('error', () => {
// As I'm outside angualr, I need a $scope.apply
$scope.$apply(this.myError)
})
}
}
}
I updated your plunk to the controllAs way of working because $scope is way
to confusing.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.