visibility:hidden in Angular 2

Viewed 86613

What's the suggested way to achieve element invisibility in angular 2 (visibility:hidden not showing the element but keeping it space occupied)?. It have a [hide] directive but it seems to be similar to a display:none

4 Answers

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>

Related