Help with option buttons path


#1

I need a little help using options buttons in lists. The list item links to the details page and the back button is automatically there. I’m trying to do the same thing to go to the same page with an option button.

My html:

<ion-list ng-class="{'has-loading': data.isLoading}">
  <ion-item ng-repeat="customer in customers" type="item-text-wrap" can-swipe="true" href="#/tab/customer/{{customer.id}}" >
    {{customer.name}}
    
    <ion-option-button class="button-positive" ng-click="showActivities({{customer.id}})">Activty</ion-option-button>
    <ion-option-button class="button-assertive">Sales</ion-option-button>
        <!--<ion-delete-button class="ion-minus-circled" 
                         ng-click="onItemDelete(friend)">
      </ion-delete-button>-->
  </ion-item>
</ion-list>

My controller part of the option button:

$scope.showActivities = function (customerID){

        $location.path('customer/'+customerID);
        
    }

Of course this does not work. It defaults to the main page. I’d like to mimic the same way the list item links so the back button is already there using this #/tab/customer/{{customer.id}}


#2

OK I’m an idiot. I needed to use:

$location.path('/tab/customer/'+customerID);

#3

Hey glad to see you were able to resolve this on your own