Closed
Description
When ng-template
is used, the Angular renderer creates comment nodes. In the context of NativeScript, these comments are invisible elements - Placeholders, which are attached to the visual tree.
Consider the following layout:
<Label text="first"></Label>
<ng-template [ngIf]="false">
<Label text="second"></Label>
</ng-template>
Since the Page
can have only child, the above will be rendered as:
(ProxyViewContainer
(CommentNode) // anchor for the second label
(ActionBar)
)
The first label gets overridden by the CommentNode
, created for the second label. In the above case, there's an easy workaround - one can simply wrap the labels in a StackLayout
. Still, there are more complicated scenarios with no easy solution.