Reputation: 1189
In Angular, we can use *ngIf directive in the template in case if we want to create/remove (also show/hide) dom element.
Is there an analog of "ngIf" directive in NativeScript without Angular?
Upvotes: 2
Views: 547
Reputation: 597
NativeScript supports the "collapsed" and "visible" states of the CSS visibility property. This means you can hide an element by setting its "visibility" property to "collapsed" in CSS.
And you can conditionally change its property which will be (near about) same as angular's ngIf
condition.
visibility="{{ showTextDetails ? 'visible' : 'collapsed' }}"
Hope this help!
Upvotes: 3