I am facing an issue with calling a global function within an Angular controller. Here is the scenario:
initiateCheckList = {};
$(function() {
initiateCheckList = function() {
...
}
Inside an Angular controller, I have a function that tries to call the global function, but I receive an error stating initiateCheckList is not defined
when executing the following code:
$scope.updateSuburbs = function () {
$scope.suburbs.getModel($scope.areas.areaId);
initiateCheckList();
};
This function is triggered by a change
event on a dropdown within the controller:
<select class="form-control" ng-model="areas.areaId" ng-change="updateSuburbs()">
I am trying to understand why Angular is not recognizing the global function and how I can resolve this issue to successfully call it.