CreateJS/PreloadJS

Queue events not being dispatched on Angular 4

dpodsiadlo opened this issue · 1 comments

Hey guys! There's a really great CreateJS wrapper for Angular and Ionic. It includes type definitions for TypeScript and allows to import CreateJS to the project very easy. There's one issue though, in PreloadS, there's a function

 p._isCanceled = function () {
	if (window.createjs == null || this.canceled) {
		return true;
	}
	return false;
};

which checks if there's a window.createjs variable declared. In my case it's undefined and the _isCanceled function always returns true, which stops loading queue every time any file is loaded. So loading single or multiple files is stopped and none of the 'fileload' or 'complete' events is being dispatched. My quick fix for it was to declare the window.createjs variable like this:

import * as createjs from 'createjs-module';
(<any>window).createjs = createjs;

Is there any chance to fix the original code, perhaps skip checking the window variable?

We're currently in the process of a version 2.0 rewrite, so we'll definitely take this into account. As for the current version, pull requests are also always welcome! There are a few other window references that may also cause issues, so if your local patch is working you might be better off waiting until v2 is released.