Reputation: 901
How exactly do you install and use createjs in Angular 4.
I have installed the @types and the package (although the package doesn't look like it has installed correctly as it has a version number of 0.0.1).
Importing createjs from createjs gets me this message:
Failed to compile.
C:/Users/Me/Documents/repos/test-createjs-app-a4/src/app/app.component.ts (2,26): File 'C:/Users/Me/Documents/repos/test-createjs-app-a4/node_modules/@types/createjs/index.d.ts' is not a module.
Upvotes: 1
Views: 1252
Reputation: 901
OK, so just figured it out.
You need to install createjs-module like this (not just createjs):
npm install createjs-module --save
And import createjs like this:
import * as createjs from 'createjs-module';
Then the usual createjs stuff is possible:
var stage = new createjs.Stage("demoCanvas");
Upvotes: 4