ng-if is used for removing or for recreating an html element to dom. When expression assigned to ng-if is evaluated to true element is recreated, if expression is evaluated to false html element is removed from dom.

ng-if example:

<script src=""></script>
<b>check the checkbox to see ng-if example .</b>
<div ng-app="" ng-init="isChecked=true">
Check or Uncheck me to see changes:<input type="checkbox" ng-model="isChecked"></input>
<input type="text" ng-if="isChecked" value="i am removed from dom if you check the check box"  
Sample Explained: In the above given sample when user check the checkBox, true is assigned to isChecked model variable else false is assigned. By default check box is checked Since isChecked variable value is initialized with true. When check box is checked text box is removed from dom and hence will not be visble to user. note: all html elements are converted into dom tree when html code is given to browser.