Has some difference between ng-if and *ngIf

Asked

Viewed 1,103 times

1

What’s the difference between ng-if and *ngIf in Angular 5? The two implementations work normally at Angular 5?

  • 1

    With *ngif you can have an Else, with ng-if no, but there may be other things I don’t know different between those two so I will comment and not reply.

  • 1

    Related: https://answall.com/q/277782/57801

  • 1

    ngIf="" is directive, *ngIf="" structural directive; it is necessary to use the * when used in template a markup indicating that ngIf="" will result in a change in the structure html, has a full answer on the stack in English: https://stackoverflow.com/questions/38271949/what-is-the-difference-between-ng-if-and-ng-if-in-angular2

1 answer

4


The ng-if was used in Angularjs

The *ngIf is used in Angular (version 2.x or higher)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.