In a Meteor application that uses Angular 2, I want to create a custom data type, something like this:
interface MyCustomType { index: number; value: string; }
Then I want to use this custom type in multiple files. I tried to create a separate file called "mycustom.type.ts" with the following contents:
export interface MyCustomType { index: number; value: string; }
Then I try to import this type so that it can be used in another file:
import MyCustomType from "./mycustom.type"
However, Atom reports the following error:
TS Error File '/.../mycustom.type.ts' is not a module ...
How can I declare and import types so that they can be used in several places?
interface angular typescript
James newton
source share