I am trying to implement loading wheel directive when we make ajax call so during the response time i want to display loading wheen, With below code i do not see any error neith
Jeesk. Most of these answers seem like overkill, why not just include the image in your controller view and toggle it with an ng-show or ng-if?
( Please pardon my use of the API or whatever. Obviously the $http request should be abstracted into a service or something. I did this quickly and it's been a bit since I have worked with Angular 1)
angular.module("whatever")
.controller("thing", function($scope, $http /* and whatever else*/) {
$scope.isShowing = false;
$scope.makeAJAXCall = function() {
$scope.isShowing = true;
$http.get("whatever.com")
.success(function() {
$scope.isShowing = false;
});
}
});
And the HTML: