custom typings files to angular 6

拜拜、爱过 提交于 2019-12-13 15:05:57

问题


I am trying to ad some custom typings definition file in angular but facing some error.

in app folder I have external folder in which I have external.d.ts file and below code

declare function format(input: string, ...args): string;

in tsconfig.json I tried adding "files": ["/app/external/external.d.ts"]

but its not working.

can somebody give me idea about adding custom typings file to angular 6.


回答1:


Add the custom typing file to typeRoots in tsconfig.json in the root folder work for me.

"typeRoots": ["node_modules/@types", "src/typings.d.ts"],



回答2:


The correct property is types inside tsconfig.json:



来源:https://stackoverflow.com/questions/51876748/custom-typings-files-to-angular-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!