Commit 1e17942a 1e17942a4b476d9a02dea6414c9b469c9631cdef by Vincent Peybernes

#11 Error on importing in browser

1 parent b72846d4
Pipeline #37 for 1e17942a passed in 3 minutes 31 seconds
...@@ -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 }
......