visibility:hidden in Angular 2

You can set the visibility style attribute with style binding:

<div [style.visibility]="'hidden'"></div>
<div [style.visibility]="isDivVisible ? 'visible' : 'hidden'"></div>

An example is shown in this plunker.

Edit: You could make a directive to make this easier: https://stackblitz.com/edit/angular-ivy-6sac33?file=src%2Fapp%2Fhide-element.directive.ts


You also can use the ability of angular to dynamically inspect your property and refresh DOM with NgStyle:

<div [ngStyle]="{'visibility':isDivVisible ? 'visible' : 'hidden'}"></div>