问题
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