Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularjs seems to throw meaningless errors

Tags:

angularjs

I keep get error logs like this in the console:

ReferenceError {}      angular.min.js:60
  (anonymous function) angular.min.js:60
  (anonymous function) angular.min.js:51
  (anonymous function) angular.min.js:88
  m                    angular.min.js:6
  e.$broadcast         angular.min.js:88
  (anonymous function) angular.min.js:80
  i                    angular.min.js:76
  i                    angular.min.js:76
  (anonymous function) angular.min.js:76
  e.$eval              angular.min.js:86
  e.$digest            angular.min.js:84
  e.$apply             angular.min.js:86
  e                    angular.min.js:92
  o                    angular.min.js:95
  q.onreadystatechange angular.min.js:96

I can usually debug it myself, but these stack traces are awfully meaningless.. am I doning somthing wrong or is this just the way it is?


1 Answers

i quote the trace provider :

ReferenceError {}      angular.min.js:60
  (anonymous function) angular.min.js:60
  (anonymous function) angular.min.js:51
  (anonymous function) angular.min.js:88

a few things , your error seems related to $http or $resource and AJAX. if you are using anonymous callbacks, name them

for instance :

$http.get("/blop")
  .success(function _successGet(){})
  .error(function _errorGet(){})

that way , you'll have some clues about the stack trace. instead of (anonymous function) you'll get a ref to _successGet or _errorGet.

like image 190
mpm Avatar answered Feb 20 '26 01:02

mpm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!