Trying to grasp some angular fundamentals by creating a class structure. Unsure if this is the right approach.
export class Cars{
Items:Car[]=[];
constructor() {
this.Items = [
{ id: "1", name: "Honda" },
{ id: "2", name: "Hyundai" },
{ id: "3", name: "Nissan" },
{ id: "4", name: "Suzuki" },
{ id: "5", name: "Audi" },
{ id: "6", name: "BMW" },
{ id: "7", name: "Mercedes" },
{ id: "8", name: "Toyota" }
];
}
}
interface Car{
id:string;
name:string;
}
Created for various components needing dropdowns of car brands. Stored in a Ts file named cars.model.ts
Seeking guidance on implementing these across different component dropdowns. Please excuse any language limitations.