| Define ng-if directive
If we need to remove or recreate some portion of HTML element based on certain expression we need ng-if Directive. ng-if is different from ng-hide because it will remove element in the DOM rather than just hiding the display of element. If the expression inside it is false then the element is removed and if it is true then the element is added to the DOM.
For example below is the syntax
< element ng-if="expression"> Contents...< /element>
if expression returns true then element is created and if it return the false then element is completely removed. | | |