I recently started using the angular-loading-bar.js to show the progress of the http call on the screen. By default the blue progress bar is displayed at the top of the screen, however instead of it being displayed at the top of the screen, I want it just within a particular div. As shown in this answer to activate the progress bar you just need to add the below line of code,
angular.module('app', ['angular-loading-bar']);
However, on doing this the progress bar gets displayed on the top of the screen, I have a div and I want that progress bar to be displayed within that particular div.
When I opened the core angular-loadingbar.js
, I found that they are inserting the progress bar using the below lines,
this.parentSelector = 'body';
this.spinnerTemplate = '<div id="loading-bar-spinner"><div class="spinner-icon"></div></div>';
this.loadingBarTemplate = '<div id="loading-bar"><div class="bar"><div class="peg"></div></div></div>';
As you can see the parent selector is the body
, is there a way through which I can change this parentSelector from the page from which is calling the loading bar?
Any help is appreciated, thanks in advance!