What is the difference between ng-if and ng-show/ng-hide

前端 未结 12 1389
执笔经年
执笔经年 2020-11-22 02:22

I\'m trying to understand the difference between ng-if and ng-show/ng-hide, but they look the same to me.

Is there a differenc

12条回答
  •  不思量自难忘°
    2020-11-22 03:22

    The ng-if directive removes the content from the page and ng-show/ng-hide uses the CSS display property to hide content.

    This is useful in case you want to use :first-child and :last-child pseudo selectors to style.

提交回复
热议问题