Kim Sean Kim Sean - 4 months ago 21
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>


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;