ng-alertify icon indicating copy to clipboard operation
ng-alertify copied to clipboard

RequireJs Problem

Open sergey-ua opened this issue 9 years ago • 3 comments

Hi,

I want to use ng-alertify in requireJs app, but faced with weird error. So it came up with "Uncaught Error: Missing alertify object". After debug I found that ng-alertify requires angular and alertify instance, if alertify instance is not defined then I get that error.

It expects it to be at window.alertify, but because of these lines:

// AMD and window support if (typeof define === "function") { define([], function () { return new Alertify(); }); } else if (typeof global.alertify === "undefined") { global.alertify = new Alertify(); } it did not set global.alertify property as define function is present in a context and that's why window.alertify is not defined and as a result the exception is thrown.

Thanks,

Sergey

sergey-ua avatar Oct 05 '15 16:10 sergey-ua

what do you want to do?will you please show your error type picture?

chuduyunhuan avatar Oct 26 '15 07:10 chuduyunhuan

@sergey-ua Could you place the alertify on the window yourself? I would hate to modify the alertify just to support AMD

bahmutov avatar Oct 26 '15 17:10 bahmutov

@sergey-ua Do you manage to make it work?

marvi14 avatar May 30 '16 19:05 marvi14