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
In a nutshell, what I would do instead would be to always have the loading wheel in the view, and just use ng-if
to control whether it shows or not.
// view
And then, whenever you go to load, just set vm.loading
(probably this.loading
depending on context) to true, and when done, false. Then the loading wheel will show up when it's ready, and go away when it's done.
It's a lot cleaner and easier than manually showing and hiding it.