Property 'id' has no initializer and is not definitely assigned in the constructor.ts(2564)
Fehlermeldung
Property 'id' has no initializer and is not definitely assigned in the constructor.ts(2564)
|
Vorkommen: in der Angular compontent.ts datei wird eine lokale Variable in Typescript erstellt
Lokale Variable in component.ts
Lösung 1:
Variable nullable machen mit ! Ausrufezeichen
Lösung 2:
Variable anhängen beim start
Global Solution
Add the following line in tsconfig.json
"strictPropertyInitialization": false,//*added
|
Fehler in Visual Code angezeigt
In tsconfig.json