I'm facing an issue with a function that needs to be called every time a page is loaded. I attempted to achieve this by using the following code:
callFunction();
function callFunction(){
$scope.onClickModel();
}
$scope.onClickModel = function (data) {
alert('Hi')
};
The problem arises when the code is executed, as an error occurs at line 3 stating that $scope.onClickModel(); is not recognized as a function. Any insight on what could be causing this error would be greatly appreciated. Thanks in advance.