
p.location-badge.
  exported from <a href='../directives'>angular2/directives</a>
  defined in <a href="https://github.com/angular/angular/tree/3a0410a/modules/angular2/src/directives/ng_if.ts#L3-L50">angular2/src/directives/ng_if.ts (line 3)</a>

:markdown
  Removes or recreates a portion of the DOM tree based on an {expression}.
  
  If the expression assigned to `ng-if` evaluates to a false value then the element
  is removed from the DOM, otherwise a clone of the element is reinserted into the DOM.
  
  # Example:
  
  ```
  <div *ng-if="errorCount > 0" class="error">
    <!-- Error message displayed when the errorCount property on the current context is greater
  than 0. -->
    {{errorCount}} errors detected
  </div>
  ```
  
  # Syntax
  
  - `<div *ng-if="condition">...</div>`
  - `<div template="ng-if condition">...</div>`
  - `<template [ng-if]="condition"><div>...</div></template>`
  
.l-main-section
  h2 Members
  .l-sub-section
    h3 constructor

    
    pre.prettyprint
      code.
        constructor(viewContainer: ViewContainerRef, protoViewRef: ProtoViewRef)
    
    :markdown
      
      




  .l-sub-section
    h3 viewContainer

    
    :markdown

      
      





  .l-sub-section
    h3 protoViewRef

    
    :markdown

      
      





  .l-sub-section
    h3 prevCondition

    
    :markdown

      
      





  .l-sub-section
    h3 ngIf

    
    :markdown

      
      




