angular-hint
angular-hint copied to clipboard
humanReadableWatchExpression error on app load
When http://citiesinmotion.iese.edu/indicecim/ (Angular v1.2.16) is debugged with Batarang the console shows the following error message on load:
"TypeError: Cannot read property 'exp' of null
at humanReadableWatchExpression (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2062)
at Scope.scopePrototype.$watch (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1840)
at new paisesCtrl (/indicecim/scripts/views/app.js:180)
at invoke (/indicecim/scripts/vendor/angular/angular.js:3870)
at Object.instantiate (/indicecim/scripts/vendor/angular/angular.js:3881)
at /indicecim/scripts/vendor/angular/angular.js:7135
at chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1538
at /indicecim/scripts/vendor/angular/angular.js:6539
at forEach (/indicecim/scripts/vendor/angular/angular.js:331)
at nodeLinkFn (/indicecim/scripts/vendor/angular/angular.js:6526)"
The app then does not load properly. (Result of some testing against apps on builtwith.angularjs.org)
Looks like we need a null check here: https://github.com/angular/angular-hint/blob/master/src/modules/scopes.js#L306
Can you find out exactly what watch is triggering the error?
Hi SomeKittens
It was as simple as you presumed. The following code made its way into the referenced app, which ultimately was passing null to $scope.$watch.
$scope.ngDatosPaises = null;
$scope.guardar = function() {
$scope.ngDatosPaises = datosPaises;
$scope.$apply();
};
$scope.$watch($scope.ngDatosPaises, function() {
// alert('hey, myVar has changed!');
// $scope.$apply();
});