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

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

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ACHARYA ANIL SURYAVANSHI

ACHARYA ANIL SURYAVANSHI

Software Engineer | Bharat Swabhiman Patanjali Social Activist | Speaker | Motivator | Yoga Trainer