This is a migrated thread and some comments may be shown as answers.

JS ERROR ReferenceError: Can't find variable: TKDataFormDelegate

2 Answers 130 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Clarence
Top achievements
Rank 2
Clarence asked on 19 Nov 2016, 05:58 AM

Hi,

I just purchased UI for NativeScript Pro, and is testing it on my new project.

I followed the instruction to download and then install the plugin. Afterwards, add the directives into app.module.ts as described in the instruction. 

Steps:

  1. Create the app (tns create ns-test1 --ng)
  2. Install the plugin (tns plugin add ~/software/Telerik/UI\ for\ NativeScript\ 1.5.1.184/Packages/nativescript-ui-pro.tgz)
  3. Import the module and declare the directives in app.module.ts. Code is shown below
import { NgModule } from '@angular/core';
import { NativeScriptModule } from 'nativescript-angular/platform';
 
// UI for NativeScript Pro
import { DATAFORM_DIRECTIVES } from 'nativescript-telerik-ui-pro/dataform/angular';
 
import { AppComponent } from './app.component';
 
@NgModule({
  declarations: [
    DATAFORM_DIRECTIVES,
    AppComponent
  ],
  bootstrap: [AppComponent],
  imports: [NativeScriptModule]
})
export class AppModule { }

 

However, after that, when run the app, the following error comes up and app was not able to start:

file:///app/tns_modules/nativescript-telerik-ui-pro/dataform/dataform.js:268:73: JS ERROR ReferenceError: Can't find variable: TKDataFormDelegate
Nov 19 13:45:00 ClarencedeiMac com.apple.CoreSimulator.SimDevice.C4DE344C-14D4-4E0A-8677-6AC5DF361731.launchd_sim[5730] (UIKitApplication:org.nativescript.nstest1[0x1b66][6530]): Service exited due to Segmentation fault: 11

 

Environment information

NativeScript version: 2.4.0
iOS and Android SDKs version: iOS Emulator (iOS 10.1)
Version of UI for NativeScript: 1.5.1.184
IDE: Visual Studio Code

 

Kindly advice

Clarence

2 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Tsonev
Telerik team
answered on 21 Nov 2016, 08:39 AM
Hi,
Thank you for interest in UI for NativeScript.

I reviewed your case, was unable to reproduce this behavior. Perhaps it could be a problem related with the `` you are using. that try to install the plugin using ` plugin add ---pro`. I am also attaching description with the steps I followed:

1. run   create ns-test1 --ng
2. run  plugin add ---pro
3. import DATAFORM_DIRECTIVES
import { NgModule } from '@angular/core';
import { NativeScriptModule } from 'nativescript-angular/platform';
  
// UI for NativeScript Pro
import { DATAFORM_DIRECTIVES } from 'nativescript-telerik-ui-pro/dataform/angular';
  
import { AppComponent } from './app.component';
  
@NgModule({
  declarations: [
    DATAFORM_DIRECTIVES,
    AppComponent
  ],
  bootstrap: [AppComponent],
  imports: [NativeScriptModule]
})
export class AppModule { }
I also tested the app with below-attached sample code.
app.component.html

<StackLayout class="p-20">
    <GridLayout >
        <RadDataForm tkExampleTitle tkToggleNavButton [source]="person"></RadDataForm>
    </GridLayout>
</StackLayout>


app.component.ts
import { Component, OnInit } from "@angular/core";
export class Person {
    public name: string;
    public age: number;
    public email: string;
    public city: string;
    public street: string;
    public streetNumber: number;
 
    constructor(name: string, age: number, email: string, city: string, street: string, streetNumber: number) {
        this.name = name;
        this.age = age;
        this.email = email;
        this.city = city;
        this.street = street;
        this.streetNumber = streetNumber;
    }
}
@Component({
    selector: "my-app",
    templateUrl: "app.component.html",
})
export class AppComponent implements OnInit{
    public person:Person;
 
    constructor(){
          
    }
 
    ngOnInit(){
        this.person =<Person> new Person("John", 23, "john@company.com", "New York", "5th Avenue", 11);
    }
     
}


Let me know whether this helps, or if I could assist you further.
Regards,
nikolay.tsonev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Clarence
Top achievements
Rank 2
answered on 21 Nov 2016, 12:41 PM

Hi,

I have followed your procedure and the plugin was installed successfully.

Thanks a lot for the help

Clarence

Tags
DataForm
Asked by
Clarence
Top achievements
Rank 2
Answers by
Nikolay Tsonev
Telerik team
Clarence
Top achievements
Rank 2
Share this question
or