Wrapper for using requireJS as JSLoader#260
Conversation
jsLoader callback param expects err as the first argument, but require() has separate callbacks for success and error. Create a wrapper to resolve conflict. Also add jsLoader.requirejs property for loaders.core to determine filetype and errors
Wrapper for using requireJS as JSLoader
|
Hmm it looks like the requirejs example isn't working anymore with this merged :-/ |
|
OK I fixed it, not sure why there was a bind(null, null), but it works without it. |
|
Sorry this is my fault, the callback should be bound to like so, if (angular.isDefined(err) && ($delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader") || $delegate.jsLoader.hasOwnProperty("requirejs")))The " Also, if may be better to not use if (err && ($delegate.jsLoader.hasOwnProperty("ocLazyLoadLoader") || $delegate.jsLoader.hasOwnProperty("requirejs"))) |
|
You're right :) |
|
I submitted PR #264 for the success callback binding. I thought about updating the callback error checking mentioned above thinking that angularjs has |
fix: success callback for requirejs wrapper Fixes #260
jsLoader callback param expects err as the first argument, but require()
has separate callbacks for success and error. Create a wrapper to
resolve conflict. Also add jsLoader.requirejs property for loaders.core
to determine filetype and errors
fixes #178