I have an empty JSON object
export class Car {}
I have imported it in a component.ts and I would like to add some fields in a loop. Something like
aux = new Car;
for (var i = 0; i < 10; i++) {
car.addName("name" + i);
}
My goal would be to get at the end the following object
car: {
name1: name1;
name2: name2;
....
}
I have created the JSON object empty because at the beginning I do not know how many elements or fields will have. I could create this object by javascript. I do not need to have an export class
is it possible?
CarandImportParameter? You're not using the second one at all in your componentcar? What isaux? Are they properties ofImportParameterclass?