Show hidden div on ng-click within ng-repeat

后端 未结 2 1483
情话喂你
情话喂你 2020-12-04 06:36

I\'m working on an Angular.js app that filters through a json file of medical procedures. I\'d like to show the details of each procedure when the name of the procedure is c

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 07:31

    Remove the display:none, and use ng-show instead:

    • {{procedure.definition}}

      Number of patient discharges: {{procedure.discharges}}

      Average amount covered by Medicare: {{procedure.covered}}

      Average total payments: {{procedure.payments}}

    Here's the fiddle: http://jsfiddle.net/asmKj/


    You can also use ng-class to toggle a class:

    I like this more, since it allows you to do some nice transitions: http://jsfiddle.net/asmKj/1/

提交回复
热议问题