There are some situations where it's better to keep a hidden component in DOM. In Vue there the v-show
in addition to the v-if
. But in Angular I didn't find an equivalent? So the best solution is to use s.th. like [ngStyle]="{ 'display': showMe ? 'block' : 'none' }"
?
EDIT: I also could set the hidden
attribute, which should have a very similar effect, e.g. [hidden]="!showMe"
.
Is there actually a reason why Vue.js did include v-show
instead of simply using :hidden
?