How to launch a method on all ng-click events AngularJS
<p>I have made a web application in Node.js that lets users manage their mongoDB database. I have several click events that do CRUD actions that change the status of the database. On each ng-click I call the corresponding function to do the CRUD action. The problem is that, in each of these functions I call the a method called refresh which updates the page so it matches the current database info. Is there a way, I can just hook up the refresh function to be called whenever a ng-click event has ended? </p>

<p>Examples </p>

<pre><code>$scope.dropDB = function (DB) {
    $http.post('/dropDB', JSON.stringify({ 'DB': DB })).success(function (response) {
        refresh();
    });
};

$scope.addDB = function (DB) {
    try{
        var objson = JSON.stringify({ 'DB': DB }) ; 
        $http.post('/addDB', objson).success(function (response) {
            console.log("DB Added: ");
            refresh();
         });
    }catch(ex){
        alert("Not a valid input type");
    }
};
</code></pre>