I've encountered an issue while trying to incorporate CreateJS into my Angular application. I have successfully installed both the typing and createjs NPM packages, and added
/// <reference types="@types/createjs" />
at the beginning of my file. While the app compiles without errors, I am facing a problem in the web browser:
ERROR ReferenceError: createjs is not defined
How can I properly define 'createjs'? Below is my TypeScript code. Any assistance would be greatly appreciated.
/// <reference types="@types/createjs" />
import { Component, AfterViewInit } from '@angular/core';
@Component({
selector: 'timeline-creator',
template: '<canvas width="1000" height="500"id="demoCanvas"></canvas>'
})
export class TimelineCreatorComponent implements AfterViewInit {
ngAfterViewInit (){
var stage = new createjs.Stage("demoCanvas")
var circle = new createjs.Shape();
circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
stage.update();
}
}