nativescript-angularnativescript-telerik-ui

Using Nativescript RadDataForm: Property 'telerik' does not exist on type 'typeof com'


I am trying to apply advanced styles to the UIStepper and SegmentedBar for the RadDataForm. I have been looking at the examples and I can run the examples locally. When trying to implement it in my own app, I get a few errors though.

ERROR in src/app/round/new/new.component.style.ts:53:44 - error TS2339: Property 'telerik' does not exist on type 'typeof com'.

53         editor.setCustomizeButtons(new com.telerik.android.common.Procedure({
                                              ~~~~~~~
src/app/round/new/new.component.style.ts:75:37 - error TS2304: Cannot find name 'TKGridLayoutAlignment'.

75         editorView.labelAlignment = TKGridLayoutAlignment.Left;
                                       ~~~~~~~~~~~~~~~~~~~~~

When looking around I found this other Stack Overflow issue on using the TKGridLayoutAlignment and the simply declare it a variable to get rid of the error. I can use the same approach to get rid of that error but I still have the Property 'telerik' does not exist on type 'typeof com' to solve.

I have tried looking at the tsconfigs and package.json's in the examples but I cannot figure out what I need to do.

What configuration/packages do I need to be able to implement the advanced styling?


Solution

  • It seems the reference.d.ts file was missing the dataform dependencies and only contained the android and ios references.

    Currently the reference.d.ts should like like this for me:

    /// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
    /// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-core/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-core/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-autocomplete/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-autocomplete/android.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-dataform/ios.d.ts" />
    /// <reference path="./node_modules/nativescript-ui-dataform/android.d.ts" />