I am getting some errors in angularjs app and I am not sure why it will come?

Hi I was working on an angular app after a few changes. I am getting an error that I am not sure why it is 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'm not sure why this is happening and I am getting 15 errors like this. This is not a violation of my application, but I can see it in the chrome console.

I 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 

      

+3


source to share


1 answer


How you can't write code in plunker, I can only guess.

Are you passing any parameter to the callback function? This usually happens when you pass something like

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

      



for angular inline functions. In the above case, when the Ajax call completes, it is called as a function, which throws an error. It should have been

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

      

In your case, you can assign "a" to some variable.

+7


source







All Articles