This is my model:
export interface IUser{
id: number;
firstName: string;
lastName: string;
accounts?:
{
userID: number;
accType: AccType;
badges: Badge[];
accountStatus: AccStatus;
}[];
}
In my user.service.ts, I'm initializing the user before using it in the HTTP services. But can't seem to initialize accounts correctly, since I can't access its values.
private initializeUser(): IUser{
return {
id:0,
firstName: null as any,
lastName: null as any,
accounts:{
userID: null as any,
accType: null as any,
badges: null as any,
accountStatus: null as any
}
};
}
Also, I think since badges are an array, I'm initializing those incorrectly as well.