<span class="location-badge">exported from <a href="/angular2/directives">angular2/directives</a></span>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/directives/if.js#L33">angular2/src/directives/if.js (line 33)</a>
:markdown
Removes or recreates a portion of the DOM tree based on an {expression}.
If the expression assigned to `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 *if="errorCount > 0" class="error">
<!-- Error message displayed when the errorCount property on the current context is greater than 0. -->