How do I toggle an ng-show in AngularJS based on a boolean?

前端 未结 6 627
日久生厌
日久生厌 2020-12-22 20:59

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 th

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-22 21:34

    Here's an example to use ngclick & ng-if directives.

    Note: that ng-if removes the element from the DOM, but ng-hide just hides the display of the element.

    
    
     
         
    Enter book name:
    Enter book category:
    Enter book price:
    Enter book author:
    You are entering book: {{book.bookDetails()}}

提交回复
热议问题