Q:

Generic component input enforces an interface - Angular

I am attempting to make a component that takes an input that can be of any type as long as it implements a specified interface. How can I do this?
For example, say that I have the following interface:
interface vehicle {
  cost: number;
  engine: string;
}

And I want to have a component that takes an input that implements the interface vehicle, but doesn't care that the actual type is a car vs a truck as it will not be using any properties on the vehicle other than those in the interface. 

A:

I found that my issue wasn't actually with using the interface, but with the way that I was using my module. If anyone else is having an issue and comes across this question, you can use an interface in the same way that you would use a class for typing of your input properties. 

