
p.location-badge.
  exported from <a href='../core'>angular2/core</a>
  defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.37/modules/angular2/src/core/directives/ng_if.ts#L3-L42">angular2/src/core/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 Annotations
  .l-sub-section
    h3.annotation Directive
    pre.prettyprint
      code.
        @Directive({selector: &#39;[ng-if]&#39;, properties: [&#39;ngIf&#39;]})


.l-main-section
  h2 Members
  .l-sub-section
    h3#constructor constructor

    
    pre.prettyprint
      code.
        constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef)
    
    :markdown




  .l-sub-section
    h3#ngIf ngIf

    
    :markdown




