Skip to content

TS custom component code files ignored #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ludwiktrammer opened this issue Nov 14, 2018 · 0 comments
Open

TS custom component code files ignored #69

ludwiktrammer opened this issue Nov 14, 2018 · 0 comments

Comments

@ludwiktrammer
Copy link

ludwiktrammer commented Nov 14, 2018

Which platform(s) does your issue occur on?

I tested on Android 8 via emulator, with --bundle.

Please, provide the following version numbers that your issue occurs with:

  • CLI: 5.0.0
  • Cross-platform modules: 5.0.1
  • Runtime(s): 5.0.0 (android)
  • Plugin(s):
    • nativescript-dev-sass: 1.6.0
    • nativescript-dev-typescript: 0.7.4
    • nativescript-dev-webpack: 0.17.0

Please, tell us how to recreate the issue in as much detail as possible.

I'm not sure if I should add this ticket here or in the main NativeScript bug tracking system. Guidance will be appreciated.

NativeScript allows for the creation of custom components. It seems that with NativeScript 5 custom component's *.ts files are ignored. They are present in the bundle, but they are not used when loading the component. If one ueses *.js files instead, the problem disappears.

  1. Follow the steps from the official documentation's "XML-based Custom Component with a Code File" section to create and load a custom component - using the TypeScript version of code samples.
  2. Run the application tns run android --bundle.
  3. Observe that "Custom Component Loaded" is never printed to the console.
  4. Delete app/components/my-control.ts and add app/components/my-control.js with the JS version of the code sample.
  5. Run the code again and observe that now "Custom Component Loaded" got printed to the console.

Is there any code involved?

Official code samples from "XML-based Custom Component with a Code File".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant