CSS changes are not applied immediately

to lower the head should change color, but the change is not seen, if I open the menu only then change can be seen.

<ion-header-bar class="thediv" ng-class="{scrolling: isActive}">
     <ion-nav-bar class="bar-clear "  >         
     </ion-nav-bar>
     </ion-header-bar>

my class:

.scrolling{
  background-color: red !important;
}

and code:

if ($ionicScrollDelegate.$getByHandle('contentScroll').getScrollPosition().top > 100) {       
     $scope.isActive = true;
} else {
    $scope.isActive = false;
}

Demo

enter image description here

my assumption is that the digest loop is not processed when you affect $scope.isActive.

Try to wrap it into a $timeout (don't forget to add $timeout as a dependency)

if ($ionicScrollDelegate.$getByHandle('contentScroll').getScrollPosition().top > 100) {       
  $timeout(function(){
     $scope.isActive = true;
  },0)
} else {
  $timeout(function(){
    $scope.isActive = false;
  },0)
}