Error Property .. has no initializer and is not definitely assigned in the constructor in typescript angular

Anil Kumar
Jan 8, 2022

The error no initializer and is not definitely assigned in the constructor comes due typescript version in latest angular version 13 onward.

strict type checking is enabled by default. Either we need always provide type and value,

strictPropertyInitialization: false inside tsconfig.json.

postfix ! to the variable name.

name!: string

--

--