#11 Error on importing in browser
Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -5,11 +5,11 @@ | ... | @@ -5,11 +5,11 @@ |
5 | (function (definition) { | 5 | (function (definition) { |
6 | 6 | ||
7 | // Node export | 7 | // Node export |
8 | if(global && module && module.exports) return module.exports = definition(); | 8 | if(typeof global != 'undefined' && typeof module != 'undefined' && module.exports) return module.exports = definition(); |
9 | //Browser export | 9 | //Browser export |
10 | if(window){ | 10 | if(typeof window != 'undefined'){ |
11 | if(angular && angular.version.major == 1) return angular.module('relative-placement-js').factory('RelativePlacement', definition); | 11 | if(typeof angular != 'undefined' && angular.version.major == 1) return angular.module('relative-placement-js').factory('RelativePlacement', definition); |
12 | if(requirejs) return define(definition()); | 12 | if(typeof requirejs != 'undefined') return define(definition()); |
13 | 13 | ||
14 | window.RelativePlacement = definition(); | 14 | window.RelativePlacement = definition(); |
15 | } | 15 | } | ... | ... |
-
Please register or sign in to post a comment