Nav buttons (rightButtons, leftButtons) not working since update


#1

I’ve updated the code to match the new update (removed nav-router, converted ng-page to views with content and so on… everything is working except for the navigation buttons, they are not being added.

Are you able to load them?

Just to give you an idea of what I used in the past.

  $scope.rightButtons = [
  content: '<i class="icon ion-navicon"></i>',
  tap: -> $scope.sideMenuController.toggleRight()
]

Bernard.


#2

Hi @BernardGatt, You pass an array of objects, it should look like the following:

$scope.leftButtons = [{
      type: 'button-icon icon ion-navicon',
      tap: function(e) {
        $scope.sideMenuController.toggleLeft();
      }
}];

#3

Thanks, @jonathan_hindi!


#4

I’m using coffee script that’s why the syntax is a bit different.


#5

I see, because I don’t know the exact syntax, anyway what I provided above is working with me, So can you provide a plunker?


#7

Created one, I placed the button creation inside the controller.

Thanks for your help.


#8

You forgot to assign the rightButtons array to the right-buttons directive on the <view> directive.

It should look like this:

<view title="navTitle" hide-back-button="true" left-buttons="leftButtons" right-buttons="rightButtons">

Here’s a working plunker


#9

You’re the man! :smile: