Angular2 supported an if-condition via the *ngIf directive.
<div *ngIf="edit == false">
<div *ngIf="edit == true">
Since Angular2 v4, the ngIf directive was extended with an ‘then.. else..’ syntax, in which you can reference the identifier of the HTML tags to include.
<div *ngIf="edit; then editDiv else viewDiv"></div>
In the TypeScript component, then in the control the ‘edit’ boolean variable.
I use the ‘if.. then.. else..’ syntax for instance to display a detail page of an object in view (Read) or edit (Create/Update) form, and adding a Delete option to the view modus to complete a CRUD option. This simplifies my application development, imo, cause now the navigation in my application is mostly from List to Detail pages.