I get the following error, when testing some javascript code, transpiled from a typescript file.
Here is the error:
Error: _mapAction2.default is not a constructor
Here is the line of code that caused the error:
var mapAction = new MapAction(MapActionType.POLYGONDRAGGED, []);
Here is the original typescript-file map-action.ts:
import { IMapAction} from './imap-action';
import { MapActionType } from './map-action-type.enum';
import {LatLngLiteral} from 'angular2-google-maps/core';
export class MapAction implements IMapAction{
type: MapActionType;
paths: Array<LatLngLiteral>;
constructor(mapActionType: MapActionType, paths: Array<LatLngLiteral>){
this.type = mapActionType;
this.paths = paths;
}
public getType(): MapActionType{
return this.type;
}
public getPaths(): Array<LatLngLiteral>
{
return this.paths;
}
}
Here is the transpiled .js-file map-action.js:
"use strict";
class MapAction {
constructor(mapActionType, paths) {
this.type = mapActionType;
this.paths = paths;
}
getType() {
return this.type;
}
getPaths() {
return this.paths;
}
}
exports.MapAction = MapAction;
//# sourceMappingURL=map-action.js.map
import {MapAction} from './map_action_file'
without exporting default – Tenterhook