Search code examples
javascriptangularangular-ng-if

Angular Difference between ngIf and ng-if


I am wondering what the difference between ngIf and ng-if is. In some sources I have seen ngIf used and in some sources ng-if used. I know ngIf vs *ngIf. That is not my question so do not get confused with that question. The dash is what I do not understand.


Solution

  • According to Angular documentation, ngIf is an Angular (v +2) directive , however, ng-if is an AngularJS (v 1.x) directive.

    as also mentioned by @rcoro in comments.