I am trying to implement the loading icon with every REST API call in my angularjs application. The solution in this thread worked great for me except in one scenario. Implementing loading spinner using httpInterceptor and AngularJS 1.1.5
The scenario is I have to bring up a bootstrap modal from the parent page. I would like to have the loading icon appear on the modal when it is processing the request. Instead the loading icon appears on the parent page in the background of the modal. Please advise how to get the icon to load on the modal (perhaps by disabling the one loading on the parent page) incase a modal is opened from the parent.
EDIT:
I am trying to use 2 spinner divs to achieve this.One at the parent level. The other one at the modal html.
#parentDiv, #modalDiv {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1100;
background-color: white;
opacity: .6;
}
.ajax-loader {
position: absolute;
left: 50%;
top: 50%;
margin-left: -32px; /* -1 * image width / 2 */
margin-top: -32px; /* -1 * image height / 2 */
display: block;
}
I have an index.html that loads the parent pages.
<div id="page-wrapper" style="overflow:hidden">
<div ui-view style="overflow:hidden"></div>
<div id="parentDiv" loader>
<img src="images/spinner.gif" class="ajax-loader"/>
</div>
</div>
On the modal html another spinner:
<div class="container-fluid >
<div id="modalDiv" loader >
<img src="images/spinner.gif" class="ajax-loader"/>
</div>
<div class="col-md-4">
<div class="form-group">
</div>
.
.
.
.
</div>
</div>