I have two type of spinner in ionic 1 framework. The ionic spinner originally has the dark background. Therefore, I turn it off with the code below.
app.js
.constant('$ionicLoadingConfig', {
noBackdrop: true,
//duration: 1800,
animation: 'fade-in',
template: '<ion-spinner icon="crescent" class="spinner-energized"></ion-spinner>',
})
app.css
.loading{
background-color:transparent!important;
}
However, I need a page with a different from others spinner. Only for the page special.js where I want the spinner with the original dark background. However, with the code I set, the spinner setting at app.js is overwrite.
special.js
$scope.$on("$ionicView.afterEnter",
function (event, data) {
$ionicLoading.show({
noBackdrop: true, duration: 1888,
template: '<ion-spinner icon="dots" class="spinner-balanced"></ion-spinner> <br/>Analyzing'
});
$scope.watchLists = $watcherFactory.getWatchLists();
$scope.currentWatchList = window.localStorage.getItem('currentWatchList');
console.log($scope.currentWatchList);
if ($scope.watchLists.length > 0)
$scope.getWatchedStocks();
else {
$ionicLoading.hide();
$scope.currentWatchList = "_";
}
special.css
.loading{
background-color:black!important;
}
How to make the spinner in special.css limited to that page only and not overwrite all the spinner?
Currently, background is set to black for all spinner
The spinner that I wanted when app.js loading is (orange color, it is not that obvious)

The spinner that I wanted when special.js loading is

Note that in the mobile app, user will jump from page to another page and I just want the special.js page to have the spinner with dark background. app.js spinner is consider the default spinner in the app except when special.js is called.
Update:(kite.js.org)
app.css
.loading {
background-color:transparent!important;
}
.special-page .loading {
background-color:black!important;
}
special.js
$rootScope.isSpecial = true;
$scope.$on('$destroy', function()
{delete $rootScope.isSpecial});
$scope.$on("$ionicView.afterEnter",
function (event, data) {
$ionicLoading.show({
noBackdrop: true, duration: 1888,
template: '<ion-spinner icon="dots" class="spinner-balanced"></ion-spinner> <br/>Analyzing'
});
$scope.watchLists = $watcherFactory.getWatchLists();
$scope.currentWatchList = window.localStorage.getItem('currentWatchList');
console.log($scope.currentWatchList);
if ($scope.watchLists.length > 0)
$scope.getWatchedStocks();
else {
$ionicLoading.hide();
$scope.currentWatchList = "_";
}
}
);
The default spinner shows transparent background but the spcial.js still show tansparent background instead of black