$ionicLoading.show() not working in controllers?


#1

Hi there, I am trying to show the loader across page changes, calling

$ionicLoading.show({
template : 'Loading...'
});

in my controllers, but it does not work. It works if I place the call in app.run();

Any suggestion?


#2

Have you injected ‘$ionicLoading’ into your controller. Or you could simply post more of your portion of the controller code.


#3

Dependencies are injected correctly, also in Dev Tools I can see the object defined and called correctly, just the overlay does not show

$scope.$on('$viewContentLoaded', function(event) {

	//show loader while we are preparing app home page (forms needs to be fetched)
	$ionicLoading.show({
            template : 'Loading...'
        });

	getForms.execute($scope.project_id).then(function(promise) {
				
	console.log(promise);
				
	$scope.forms = promise.forms;

        $ionicLoading.hide();
				
        });
});