Q:

angular ng-click ternary conditional

I'm making a pagination system with the "next" button. The "next" button should increase the page.currentPage variable, but it should not do anything when it reached the maximum numPagesTotal.
How do I add this condition to the following ng-click expression:
<a ng-click="page.currentPage = page.currentPage + 1">Next</a>

I figured that I need another block variable that is set to true when page.currentPage === numPagesTotal, and do something like below:
<a ng-click="block || page.currentPage = page.currentPage + 1">Next</a>

How do I set block in the ng-click?
jsFiddle, for reference

A:

I think this does what you want.
<a ng-click="page.currentPage >= numPagin || (page.currentPage=page.currentPage+1)">next</a>

