Turning off Strict Mode in Angular?
If anybody runs into this question, I had a similar issue after upgrading from Angular 8 to Angular 10. I had to remove all angular compiler flags, and used the following TS flags:
On tsconfig.json:
"compilerOptions": {
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"experimentalDecorators": true,
"module": "es2020",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"noImplicitUseStrict": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
On angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"my-project-name": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": false
}
}
}
}
}
Following Angular doc, the strict mode can be disabled turning off these flags on tsconfig.json file:
"forceConsistentCasingInFileNames": false,
"strict": false,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": false,
...
"angularCompilerOptions": {
"strictInjectionParameters": false,
"strictInputAccessModifiers": false,
"strictTemplates": false
}