0

Help make angularjs ng click dealing with two functions. I tried but it is not working. theshowtakeorder shows and hide a div and the takeorderfunction must execute a function from the controller.

<button ng-click="takeorderfunction() showtakeorder = !showtakeorder">TAKE ORDER</button>
1
  • Create third function which call both of them. Commented Aug 25, 2016 at 4:35

1 Answer 1

1

Try with a semi-colon:

<button ng-click="takeorderfunction(); showtakeorder = !showtakeorder">TAKE ORDER</button>

Or better yet place your logic in another function:

<button ng-click="clickFunction()">TAKE ORDER</button>

controller:

$scope.clickFunction = function(){
    takeorderfunction();
    showtakeorder = !showtakeorder;
}
Sign up to request clarification or add additional context in comments.

Comments

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.