Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I am getting few errors on angularjs app which I am not sure why it's coming?

Hi I was working on angular app after few changes I am getting an error which I am not sure why it's coming.

error : TypeError: a is not a function
at angular.min.js:70
at m.promise.then.u (angular.min.js:97)
at m.promise.then.u (angular.min.js:97)
at angular.min.js:98
at h.$get.h.$eval (angular.min.js:108)
at h.$get.h.$digest (angular.min.js:106)
at h.$get.h.$apply (angular.min.js:109)
at f (angular.min.js:71)
at F (angular.min.js:75)
at XMLHttpRequest.x.onreadystatechange (angular.min.js:76)(anonymous function) @ angular.min.js:89$get @ angular.min.js:66m.promise.then.u @ angular.min.js:97m.promise.then.u @ angular.min.js:97(anonymous function) @ angular.min.js:98$get.h.$eval @ angular.min.js:108$get.h.$digest @ angular.min.js:106$get.h.$apply @ angular.min.js:109f @ angular.min.js:71F @ angular.min.js:75x.onreadystatechange @ angular.min.js:76XMLHttpRequest.send (async)b @ angular.min.js:77z @ angular.min.js:72$get.f @ angular.min.js:70m.promise.then.u @ angular.min.js:97m.promise.then.u @ angular.min.js:97(anonymous function) @ angular.min.js:98$get.h.$eval @ angular.min.js:108$get.h.$digest @ angular.min.js:106$get.h.$apply @ angular.min.js:109(anonymous function) @ angular.min.js:18d @ angular.min.js:34c @ angular.min.js:17$b @ angular.min.js:18Wc @ angular.min.js:17(anonymous function) @ angular.min.js:209v.Callbacks.l @ jquery.min.js:2v.Callbacks.c.fireWith @ jquery.min.js:2v.extend.ready @ jquery.min.js:2A @ jquery.min.js:2

I am not sure why this is coming and I am getting such 15 errors. It is not breaking my app but I am seeing this on chrome console.

I have changed from min.js to .js got this error :

TypeError: fn is not a function at angular.js:7946 
at wrappedCallback (angular.js:11319) 
at wrappedCallback (angular.js:11319) 
at angular.js:11405 
at Scope.$eval (angular.js:12412) 
at Scope.$digest (angular.js:12224) 
at Scope.$apply (angular.js:12516) 
at done (angular.js:8204) 
at completeRequest (angular.js:8412) 
at XMLHttpRequest.xhr.onreadystatechange (angular.js:8351)(anonymous function) @ angular.js:9778 
like image 519
Samir Shah Avatar asked Dec 02 '25 06:12

Samir Shah


1 Answers

As you cant place code in plunker I can only guess.

Are you passing any parameter to callback function? Usually it happens when you pass something like

.success($scope.message = "Task completed") 

to in-build angular functions. In above case when the Ajax call completes, it is being invoked as a function, thus causing the error. It should have been as

.success(function () {
    $scope.message = "Task completed";
})

In your case you may be assigning "a" to some variable.

like image 172
Virendra Shenvi Velingkar Avatar answered Dec 03 '25 22:12

Virendra Shenvi Velingkar



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!