My goal is to create and initialize an array of a class in Angular 5.
export class B{
public Colors: string;
public Temp: number;
public Numbers: number;
}
export class A{
public MyTable: B[];
public othervar: number;
...
...
}
Next, I proceed to initialize MyTable using the following code:
var test = new A();
test.MyTable[0].Numbers = 25;
test.MyTable[0].Colors= "blue";
Is this the correct way to do it?