I work on angular and I am unable to assign value to the key. My model is like below
export class aa{
types: bb[];
}
export interface bb{
name: string;
age: string;
}
On my ts file, I did:
newType: bb;
initValues(){
this.newType.name = 'Anna'; //error at this line
}
but I am getting an error as cannot get property of undefined.
Where am I going wrong? How can I assign value to a key in angular