Following is my angular controller code -
$scope.visibility = true;
$http.get("/api/getempl").then(function(response){
if (response.status == 200) {
$scope.empData = response.data.data;
(function(){
setTimeout(function(){
$scope.visibility = false;
}, 4000);
})();
}
});
What I am trying is to show Loading Image till data not fetched and flagging $scope.visibility on response basis -
.col-md-12(ng-show="visibility")
h1 LOADING
.col-md-12(ng-show="!visibility")
// DATA IN TABLE
Now LOADING text is always visible as I am expecting once data fetched, after a delay show table data but its not working, let me know what I am doing wrong here.