I'm trying to figure out the best approach for declaring an array of objects as a property in TypeScript when defining a class. I need this for a form that will contain an unspecified number of checkboxes in an Angular Template-Driven form.
Should I create a separate class for the objects, like I've done below, or is there a more efficient method? I've searched extensively for guidance on this but haven't found much. Am I completely missing the mark here?
export class Companion {
id: string;
name: string;
chosen: boolean;
}
export class ExampleForm {
name: string;
email: string;
companions: Companion[];
}