user1381745
user1381745

Reputation: 3900

Typescript insists that a particular file "is not a module"

I'm trying to export a simple object to act as a (non-sensitive) configuration container, e.g. config.ts:

export var Config {
    "environment": "development"
};

And then import it elsewhere in my Angular2 application:

import {Config} from 'config';

The TS compiler, though, claims that config.ts is not a module. I've not written TS files that are to be imported elsewhere, so I'm probably missing something very simple, but could anyone point me in the correct direction for making this data import/exportable?

Upvotes: 0

Views: 90

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657068

There is an = missing:

export var Config = {
    "environment": "development"
};

Upvotes: 3

Related Questions