Angular ng-if and ng-show combination

后端 未结 4 596
不知归路
不知归路 2020-12-31 06:18

Imagine some heavy content that might be rendered on a web page, such as a chart. Angular gives 2 options to toggle the visibility of said content.

ng-show

4条回答
  •  盖世英雄少女心
    2020-12-31 07:22

    You could make it work by using ngIf and ngShow together, where each one is controller by different variable. ngIf is going to be set to true once and never set to false again, while ngShow will be toggled as much as the user wants to.

    Take a look at this fiddle.

提交回复
热议问题