1

How exactly can I use easeljs in Angular2?

I have found this question:

working-with-easeljs

but the answerer merely states how to install the typings. But then what?

I have roughly the same issue with this blog post:

adding-typescript-definitions-to-angular2

Again, shows how to add the typings but then what? Do I need to import something?

Here is a simple component that I would like to get working:

import { Component, OnInit } from '@angular/core';



@Component({
selector: 'app-test',
template: `
    <canvas id="demoCanvas" width="500" height="300" style="border: 1px solid black;"></canvas>
`
})
export class TestComponent implements OnInit {

constructor() { }

ngOnInit() {

    var stage = createjs.Stage("demoCanvas");       
    var circle = createjs.Shape();
    circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
    circle.x = 100;
    circle.y = 100;
    stage.addChild(circle);



}

}

But what do I do then?

Community
  • 1
  • 1
James Satori-Brunet
  • 901
  • 2
  • 13
  • 28
  • Have a look at this question and answers: http://stackoverflow.com/questions/28989399/do-i-have-to-reference-typescript-definition-in-every-file – Lanny Nov 04 '16 at 21:13
  • I checked the answer above, but did not figure out how to do it right. Do you have a checklist, WHICH file to include in the files array in tsconfig.json??? Did that solve your problems? I run into a Stage is not a constructor error, but I have no clue if that is connected to the above problem (I guess so). – cojack20 May 22 '17 at 15:02

0 Answers0