JS ERROR ReferenceError: Can't find variable: TKDataFormDelegate

3 posts, 1 answers
  1. Clarence
    Clarence avatar
    12 posts
    Member since:
    Nov 2016

    Posted 18 Nov 2016 Link to this post

    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. Answer
    nikolay.tsonev
    Admin
    nikolay.tsonev avatar
    123 posts

    Posted 21 Nov 2016 Link to this post

    Hi,
    Thank you for interest in UI for NativeScript.

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

    1. run  tns create ns-test1 --ng
    2. run tns plugin add nativescript-telerik-ui-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
  3. Clarence
    Clarence avatar
    12 posts
    Member since:
    Nov 2016

    Posted 21 Nov 2016 in reply to nikolay.tsonev Link to this post

    Hi,

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

    Thanks a lot for the help

    Clarence

Back to Top