Idrees Khan
Idrees Khan

Reputation: 7752

NativeScript RadListView rootLocator is not a function

I have used RadListView as following but i am getting very strange error:

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

Just like as it is here https://github.com/telerik/nativescript-ui-samples-angular/tree/release/sdkAngular/app/listview/getting-started.
But the problem is i am getting following exception: enter image description here

Upvotes: 2

Views: 358

Answers (2)

Idrees Khan
Idrees Khan

Reputation: 7752

The problem was the dependencies. I updated the dependencies and version number(s) according to this file as described here. And its working fine now.

Upvotes: 2

Nikolay Tsonev
Nikolay Tsonev

Reputation: 1919

Try to upgrade all dependencies in your package.json file, while following the below-attached sample and try to rebuild your app.

{
  "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"
  }
}

Bear in mind to delete again node_modules, platforms, and hooks folders before the rebuild.

Upvotes: 2

Related Questions