I need to create a loadbar and leave it active until the function is finished. Can I do this in the angle?
$scope.getPosts = function () {
$http({
method: 'POST',
url: '/getPosts',
}).then(function(response) {
return response.data;
}, function(error) {
console.log(error);
});
};