Hello Team,
My AngularJS Controller says function is not defined, kindly help.
(function () {
}
}
])
}).call(anguler);
Hello Team,
My AngularJS Controller says function is not defined, kindly help.
(function () {
}
}
])
}).call(anguler);
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vishal JoshiRank #377 · 6.7K reputationPosted Nov 5, 2023, 1:02 AM EST
Hello Emma,
Looks like a minor typo issue. it should be angular not anguler.
Please try the code below it should work.
(function () { } }) }).call(angular);Thanks
Vishal Joshi
Prasad RaveendranRank #320 · 7.8K reputationPosted Nov 3, 2023, 11:54 PM EDT
It seems there's an issue in the code you've provided. It looks like there might be a typo in the usage of AngularJS.
AngularJS uses the
controllermethod to define controllers. Here's a basic example of how you might define an AngularJS controller:(function () { angular.module('myApp', []) // Define the module .controller('MyController', function () { // Your controller logic goes here }); })();Ensure that:
angular.moduleis created with a module name.controllermethod is used within the module to define the controller.The error you're encountering might be due to an undefined function or a missing reference to the function inside the controller definition. Also, the
.call(anguler)at the end of your code is incorrect; it seems to have a typo (angulerinstead ofangular).Make sure your code follows the standard AngularJS controller definition pattern and correct any typos in the code. This will likely resolve the "function is not defined" error you're encountering.
If you are planning new application development, I would recommend latest frameworks such as Angular, React, VueJS