ng-show

Show an element when an expression is truthy.

Toggles the CSS display property of an element without removing it from the DOM. The element’s scope is always alive, regardless of visibility.

<div ng-hide="isLoading">Content here</div>

ng-show

  • Type: expression
  • Required: yes

When truthy, the element is visible (removes the ng-hide CSS class). When falsy, the element is hidden.

ng-hide

  • Type: expression
  • Required: yes

Inverse of ng-show. When truthy, the element is hidden.

Animation hooks: .ng-hide-add / .ng-hide-add-active when hiding, .ng-hide-remove / .ng-hide-remove-active when showing.

ng-if vs ng-show/hide

Aspectng-ifng-show / ng-hide
DOM presenceRemoved when falseAlways in DOM
Scope lifetimeDestroyed when falseAlways alive
Child watchersRemoved when falseAlways active
Initial render costOnly when trueAlways rendered
Animation eventsng-enter / ng-leaveng-hide-add / ng-hide-remove

Use ng-if when the content is expensive to render or when you want to prevent hidden content from making network requests.
Use ng-show/hide when toggling frequently and you need instant re-display without re-initiali