I'm trying to follow an example from Adam Freeman's book on Angular and now stuck with Using a Form Model for Validation.
I have a similar issue as in Angular Typescript FormGroup assigning value after submit.
However, the accepted answer in that post didn't actually help me, because I got another error message: "Type 'any' is not assignable to type 'never'.ts(2322)".
So, I have an object of class Product:
export class Product {
constructor(public id?: number,
public name?: string,
public category?: string,
public price?: number) {}
}
In the form class I'm trying to do the following:

Why does TS state: this.newProduct[c] is of type 'never'? And how do I make it work?