Add custom typings files to Angular CLI

前端 未结 1 917
-上瘾入骨i
-上瘾入骨i 2021-01-11 16:55

I have a SPA with Angular CLI framework and a Javascript library written by a team member. I need to inject this JS file into the app. My thought is

  1. to write
相关标签:
1条回答
  • 2021-01-11 17:47

    You have a couple of options here:

    1. In the src dir for newly created applications there is a file typings.d.ts which you can use reference your team member's .d.ts file which will expose those types throughout your application.

    2. In the tsconfig.json file you can add the path to the node_modules folder where this package lives to the typeRoots array which will make those typing available too.

    0 讨论(0)
提交回复
热议问题