Answer the question
In order to leave comments, you need to log in
How can I set typescript to skip the "any" type?
All the best!
I began to slowly write my first application in angular 2 with typescript.
I already understood typescript very meticulous :) Now I want to connect someone else's component (for uploading files) to my application, where the any type is used , but the compiler does not allow it :(
app/upload.component.ts(24,16): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/ng2-uploader/src/directives/ng-file-drop.ts(21,39): error TS7006: Parameter 'data' implicitly has an 'any' type.
node_modules/ng2-uploader/src/directives/ng-file-drop.ts(29,53): error TS7006: Parameter 'e' implicitly has an 'any' type.
node_modules/ng2-uploader/src/directives/ng-file-drop.ts(41,58): error TS7006: Parameter 'e' implicitly has an 'any' type.
node_modules/ng2-uploader/src/directives/ng-file-drop.ts(46,57): error TS7006: Parameter 'e' implicitly has an 'any' type.
node_modules/ng2-uploader/src/directives/ng-file-select.ts(21,39): error TS7006: Parameter 'data' implicitly has an 'any' type.
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" "
Answer the question
In order to leave comments, you need to log in
The TypeScript compiler has a noImplicitAny flag that controls how the case when no type is specified is handled. In your case, the parameter does not have a type specified and noImplicitAny is enabled, so TypeScript swears.
Put in tsconfig.json in compiler options "noImplicitAny": false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question