xxxxxxxxxx
//inside tsconfig.json file
"angularCompilerOptions": {
// ...
"strictPropertyInitialization": false
// ...
}
xxxxxxxxxx
//inside tsconfig.json file
"angularCompilerOptions": {
// ...
"strictPropertyInitialization": false
// ...
}
Just go to tsconfig.json and set
"strictPropertyInitialization": false
to get rid of the compilation error.
Otherwise you need to initialize all your variables which is a little bit annoying
xxxxxxxxxx
"angularCompilerOptions": {
// ...
"strictPropertyInitialization": false
// ...
}
xxxxxxxxxx
// tsconfig.json
"compilerOptions": {
// ...
"strictPropertyInitialization": false,
// ...
}
// OR
@Component({ })
export class Component {
@Input() myInput: string|undefined;
}
// OR
@Component({ })
export class Component {
@Input() myInput!: string;
}
xxxxxxxxxx
Just go to tsconfig.json and set
"strictPropertyInitialization": false
to get rid of the compilation error.
Otherwise you need to initialize all your variables which is a little bit annoying
xxxxxxxxxx
"strictPropertyInitialization": false
xxxxxxxxxx
{
"compilerOptions": {
.
"noImplicitReturns": false,
.
"strictPropertyInitialization": false
},
"angularCompilerOptions": {
}
}
xxxxxxxxxx
strictPropertyInitialization flag in typescript compiler options in tsconfig.json file.
"compilerOptions": {
///
,
"strictPropertyInitialization":false
}
xxxxxxxxxx
Go to tsconfig.json
add "strictPropertyInitialization": false, in "compilerOptions":
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strictPropertyInitialization": false,