kensho-technologies / ng-alertify

[DEPRECATED] AngularJS wrapper around alertify popup library
http://kensho.github.io/ng-alertify/
MIT License
18 stars 14 forks source link

RequireJs Problem #13

Open sergey-ua opened 8 years ago

sergey-ua commented 8 years ago

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

chuduyunhuan commented 8 years ago

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

bahmutov commented 8 years ago

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

marvi14 commented 8 years ago

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