【问题标题】:Is NativeScript Angular xml space sensitiveNativeScript Angular xml 空间是否敏感
【发布时间】: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


    【解决方案1】:

    据我所知

    </ListView>
    
    
    </GridLayout>
    

    这应该工作..!! 看看你能不能在操场上重现这个错误并在这里分享..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-20
      • 1970-01-01
      相关资源
      最近更新 更多