petermuessig / typescript-app-and-lib-plus-npm-packages

TypeScript App connected to TypeScript UI Library plus using NPM packages
Apache License 2.0
6 stars 0 forks source link

Get Access to the CustomControl from a Lib in App.controller.ts #1

Closed Kasde96 closed 4 months ago

Kasde96 commented 5 months ago

Hallo @petermuessig,

I want to import my "Example" control into App.controller.ts. When I start the app, it works fine. Unfortunately, the linter in the file tells me that it does not have access to the module. Also the code completion does not work properly because the module is not recognized. How do I manage to import the control into the controller?

image.

Thanks,

Dominik

petermuessig commented 5 months ago

Hi @Kasde96 ,

the library needs to be built first - the dist folder with the types must exist. Sometimes after that it maybe necessary to restart the linter to find the new types - but in most cases it should be sufficient to build the library and then close and open the editor for the controller again.

HTH and BR, Peter

Kasde96 commented 4 months ago

Hi @petermuessig ,

sorry for the late response. Thank you for your guidance, it resolved my issue. Additionally, I encountered a problem where the fiori add deploy-config command changes the ui5.yaml file. It is important that the customTask: ui5-tooling-transpile-task is not modified. However, the command did make changes to it.

builder:
  customTasks:
    - name: ui5-tooling-transpile-task
      afterTask: replaceVersion
      configuration:
        generateTsInterfaces: false # always generate the TS interfaces in build

I close the issue.

Thanks, Dominik