【发布时间】:2020-07-02 06:03:46
【问题描述】:
我一直在尝试 NativeScript Angular,并从 Windows 上使用 VSCode 的默认 Angular 应用程序开始(这应该没关系)。默认应用程序的 items 组件具有以下 xml:
<GridLayout>
<ListView [items]="items">
<ng-template let-item="item">
<StackLayout>
<Label [nsRouterLink]="['/item', item.id]" [text]="item.name"></Label>
</StackLayout>
</ng-template>
</ListView>
</GridLayout>
现在,如果我在终止 GridLayout 标记之前添加一个额外的空间,即在上面的最后一行,应用程序会中断并显示以下消息:
An uncaught Exception occurred on "main" thread.
Calling js method run failed
Error: View not added to this instance. View: ProxyViewContainer(8) CurrentParent: Page(4) ExpectedParent: AppHostView(1)
我找不到任何指定必须格式化 xml 的文档。这是预期的行为还是我的设置有问题?
【问题讨论】:
标签: nativescript nativescript-angular