When to use Interface and Model in TypeScript / Angular
Interfaces are only at compile time. This allows only you to check that the expected data received follows a particular structure. For this you can cast your content to this interface: this.http.get(‘…’) .map(res => <Product[]>res.json()); See these questions: How do I cast a JSON object to a typescript class How to get Date object from … Read more