$scope variables on nav-bar

Hello!

I am trying to set a badge in top of and icon (like notifications) that is located on the header, with dynamic content. I’m using nav-bar and I can’t get the scope to be shown there.

$scope.leftButtons = [
  { 
    type: 'button-clear',
    content: '<i class="icon ion-navicon"></i><span ng-show="new_items>0" class="badge badge-assertive">{{new_items}}</span>',
    tap: function(e) {
      $scope.toggleMenu();
    }
  }
  
];

It is shown {{new_items}} instead of the number, and the scope is set.

Thanks in advance.

1 Like

Hi @vberis,

Right now unfortunately you can’t set any sort of angular expression in left/right buttons.

This is planned to be fixed before 1.0 beta: https://github.com/driftyco/ionic/issues/596