I have an external JavaScript file with additional functions that I am trying to call from an Angular controller.
Here is an example of the external.js file:
...
...
function fun() {
...
...
}
...
...
The controller in question is called acccountController.js:
myApp.controller('AddAccountController', function ($scope, AddAccountLoginServices, $location, localStorageService, $compile, toaster) {
....
....
$scope.getLoginForm = function(siteId, name) {
...
...
fun(); // Calling a function from the external.js file
});
...
...
});
I have imported external.js before the acccountController.js, but the function is not being called without any console errors. How can I achieve this successfully? Thank you in advance.