From e95da45ee4f5798b1d9c549377b1514e43d39092 Mon Sep 17 00:00:00 2001 From: Brad Date: Tue, 3 Jan 2017 10:46:47 -0800 Subject: [PATCH 1/2] fix: NW.js module is not defined fix. Now the factory assignment for localforage is applied to `global.modules.exports` instead of `modules.exports` if `module` is undefined. `module` is undefined in an NW.js environment (for whatever reason). So now we check for module and we uses global if `module` is undefined. Otherwise we proceed as before. Thank @ashleyhindle for fix. Fixes #77 --- dist/angular-localForage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/angular-localForage.js b/dist/angular-localForage.js index ad541a9..73c321d 100644 --- a/dist/angular-localForage.js +++ b/dist/angular-localForage.js @@ -14,7 +14,11 @@ return factory(angular, localforage); }); } else if(typeof exports === 'object' || typeof global === 'object') { - module.exports = factory(angular, require('localforage')); // Node/Browserify + if(typeof module === 'undefined') { + global.module.exports = factory(angular, require('localforage')); // NW.js + } else { + modules.exports = factory(angular, require('localforage')); // Node/Browserify + } } else { return factory(angular, root.localforage); // Browser } From e4317159560329f29c60a39f53f800706c6c4750 Mon Sep 17 00:00:00 2001 From: Brad Date: Wed, 4 Jan 2017 10:36:09 -0800 Subject: [PATCH 2/2] Fix: Fixed typo modules to module --- dist/angular-localForage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/angular-localForage.js b/dist/angular-localForage.js index 73c321d..516eb45 100644 --- a/dist/angular-localForage.js +++ b/dist/angular-localForage.js @@ -17,7 +17,7 @@ if(typeof module === 'undefined') { global.module.exports = factory(angular, require('localforage')); // NW.js } else { - modules.exports = factory(angular, require('localforage')); // Node/Browserify + module.exports = factory(angular, require('localforage')); // Node/Browserify } } else { return factory(angular, root.localforage); // Browser