How do I toggle an ng-show in AngularJS based on a boolean?
I have a form for replying to messages that I want to show only when isReplyFormOpen is true, and everytime I click the reply button I want to toggle whether the form is shown or not. How can I do this? Nitu Bansal You just need to toggle the value of "isReplyFormOpen" on ng-click event <a ng-click="isReplyFormOpen = !isReplyFormOpen">Reply</a> <div ng-show="isReplyFormOpen" id="replyForm"> </div> liamzebedee Basically I solved it by NOT -ing the isReplyFormOpen value whenever it is clicked: <a ng-click="isReplyFormOpen = !isReplyFormOpen">Reply</a> <div ng-init="isReplyFormOpen = false" ng