angular - NativeScript RadListView rootLocator 不是一个函数

标签 angular telerik nativescript

我已经使用了 RadListView,如下所示,但我遇到了非常奇怪的错误:

        <RadListView [items]="dataItems">
            <ng-template tkListItemTemplate let-item="item">
                <StackLayout orientation="vertical">
                    <Label class="nameLabel" [text]="item.title"></Label>
                </StackLayout>
            </ng-template>
        </RadListView>

就像这里一样https://github.com/telerik/nativescript-ui-samples-angular/tree/release/sdkAngular/app/listview/getting-started
但问题是我遇到以下异常: enter image description here

最佳答案

尝试升级 package.json 文件中的所有依赖项,同时按照下面所附的示例进行操作,并尝试重建您的应用。

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.test"
  },
  "dependencies": {
    "@angular/animations": "~4.2.0",
    "@angular/common": "~4.2.0",
    "@angular/compiler": "~4.2.0",
    "@angular/core": "~4.2.0",
    "@angular/forms": "~4.2.0",
    "@angular/http": "~4.2.0",
    "@angular/platform-browser": "~4.2.0",
    "@angular/router": "~4.2.0",
    "nativescript-angular": "~4.2.0",
    "nativescript-telerik-ui-pro": "^3.0.4",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.4.2",
    "tns-core-modules": "~3.1.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "nativescript-dev-typescript": "~0.5.0",
    "typescript": "~2.4.2"
  }
}

请记住在重建之前再次删除 node_modules、platforms 和 hooks 文件夹。

关于angular - NativeScript RadListView rootLocator 不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45915170/

相关文章:

visual-studio-code - VS 代码中的扩展警告

html - 为什么我的导航栏没有覆盖整个屏幕?

node.js - 如何访问上传到 nestjs 服务器的图片

angular - 类型错误 : Object doesn't support property or method 'map' - AngularJS2

angular - 从组件模板访问变量指令

javascript - 使用 NativeScript 的混合应用程序

安卓模拟器不工作。 gradle构建错误

c# - 使用 c# (telerik) 在 wpf 中自定义弹出窗口设计

asp.net - 在多选 RadComboBox 中设置 "Selected Item"

nativescript - 在 NativeScript 中流式传输 json