I am trying to declare:
type ArticleModel = {
_id: number;
name: string;
}
Then in my class:
public models: ArticleModel[];
Where models should be as you may have guess an array of ArticleModel.
But node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js throws:
error TS2322: Type 'Object[]' is not assignable to type '{ _id: number; name: string; }[]'.
Type 'Object' is not assignable to type '{ _id: number; name: string; }'.
Property 'id' is missing in type 'Object'..
Any help would be appreciated.
Thanks in advance.