Dynamic template in $ionicLoader


Is there a way to dynamically manage the $ionicLoader template?

For example, our necessity is to maintain a “stack” of loaders, meaning the same loader will stay visible until the end of the stack, but updating an eventual loading message.



Not sure what u mean . You want to keep the loader visible and change the text during its visibility ?


exactly, if possible without the need to destroy and recreate a new loader every time.


This is the default loading function.

$scope.show = function () {
                        template: 'Loading...'

You can change it to be

$scope.show = function (text) {
template: text

And then call it inside your code with whatever text you want to display.

for example:

$scope.show('Building Awesomness ....');

Whenever the method $scope.hide() is called it will hide it whatever the message is.

Hope this solves it :slight_smile: