My current project involves utilizing an interface for vehicles.
export interface Vehicle {
IdNumber: number;
isNew: boolean;
contact: {
firstName: string;
lastName: string;
cellPhoneNumber: number;
};
color: string;
}
Within my component, I am importing this interface to use in the code.
let car: Vehicle = {
IdNumber: 1,
isNew: true,
contact: {
firstName: 'John',
lastName: 'Doe',
cellPhoneNumber: 123,
},
color: 'red',
};
However, when trying to compile this code, webpack is showing an error message:
Types of property 'contact' are incompatible.