Kim Sean Kim Sean - 1 year ago 102
AngularJS Question

angularjs ngclick dealing with two function

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>

Answer Source

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>


$scope.clickFunction = function(){
    showtakeorder = !showtakeorder;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download