Search code examples
javascriptangularjsionic-frameworkionic-view

Href doesn’t work in ion-option-button?


hy guys, in an Ionic project I made a ion-list ion-items and these ion-option-buttons:

  <ion-item ng-repeat="(id,place) in places" >

    <h2>{{place.name}}</h2>

    <ion-option-button class="button-positive" href="#/tab/place/{{id}}">
      edit
    </ion-option-button>
  </ion-item>

but href="..." is not working

Thanks for help


Solution

  • I solved the problem:

    template:

    <ion-option-button class="button-positive" ng-click="goTo('edit-place',{'placeId':id})">
    

    Controller:

    $scope.goTo=function (state,params) {
        $state.go(state,params);
     }