Ionic - How to change header-bar style with a variable

I created an Ionic app with ‘ionic start myApp sidemenu’, added a login page and now I want to customize my headers style according with the type of user entered in the login, lets say positive class for admins and calm for normal users for example. I’ve try to change the class from the controller with a variable, but it is not working, here is my code:


.state('app', {
url: '/app',
abstract: true,
templateUrl: 'js/app/menu/sideMenu.html',

.state('login', {
url: '/login',
templateUrl: 'js/app/Login/login.html',
controller: 'loginController'


.controller('appController', function(sessionService, $scope, $stateParams, $state) {
                $scope.ambiente = sessionService.getAmbiente();
                console.log('The class is:'+$scope.ambiente);

The service sessionService.getAmbiente() returns the name of the class saved after login with window.localStorage, it works fine.



  <ion-side-menu side="left">

            <!--**** Using ng-class**** -->
<ion-header-bar  ng-class="ambiente"><!--ng-class="ambiente"-->
  <h1 class="title">Menu</h1>




          <!--**** Using an expression**** -->
    <ion-nav-bar class={{ambiente}}>
    <ion-nav-view name="menuContent"></ion-nav-view>

I also tried using a variable in the $rootScope but I think it is not the most proper way and it did not refresh fine when the type of user changed.