0

I have a button that redirect me to another view, in a href tag. When I click on the button its redirect me to a href view. like:

<a ng-click="gotoChat()" /*Redirect to another view
        class="item item-avatar-right item-icon-left">
  <i class="icon" ng-hide="{{item.toClose}} == 0">
    <button ng-click="Close('{{item.key}}')" class="button button-assertive">סגור    בקשה</button>
   </i>*/When I click on the button its start gotoChat() and Close() instead of only Close()
</a>

How can I do that its redirect me to button function?

1 Answer 1

1

Change href to div in html as follow

<div ng-click="gotoChat()" class="item item-avatar-right item-icon-left">
   <i class="icon" ng-hide="{{item.toClose}} == 0"><button ng-click="Close('{{item.key}}')" class="button button-assertive">סגור בקשה</button></i>*/When I click on the button its redirect me to a href function
</div>

and in your controller

$scope.gotoChat = function(){
   $state.go("STATE OF PAGE FOR REDIRECT");
}
Sign up to request clarification or add additional context in comments.

1 Comment

I have the same problem with you code. when I click on the button its start gotoChat() and Close() instead of only Close()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.