How can I build a service that can be called from everywhere I need with a custom param.
I have this code:
.service('loadingService', function($ionicLoading) {
this.showLoading=function(textToBeDisplayed){
$ionicLoading.show({
noBackdrop: false,
templateUrl: 'templates/loading-template.html'
});
};
this.hideLoading=function(){
$ionicLoading.hide();
};
});
View: (loading-template.html)
<div>{{textToBeDisplayed}}<ion-spinner icon="ios"/></div>
Controller:
loadingService.showLoading('loading all data');
Loading is displayed but "textToBeDisplayed" is not visible in the view.
Any ideeas ?
Thanks
$rootScope