I have this code and I have made a refresh function which states the purpose obviously. I have to refresh other stats as well but I can't call it inside the "refresh" function below even they are in same scope. I am sure that I am calling it right but console keeps giving the following error:
ReferenceError: getAllCustomers is not defined
$scope.getAllCustomers = new function(){
$http.post('
<?php echo site_url('angularjs/get_users_by_type/'); ?>',
{userType:'C'}).then(function(response) {
$scope.totalCustomer = response.data.count;
}, function(response) {
console.log(response);
// called asynchronously if an error occurs
// or server returns response with an error status.
});
};
// getAllCustomer etc all defined before this function but the following errors keeps coming on the console that getAllCustomers is not a function.
$scope.refresh = new function(){
$scope.getAllCustomers();
};