Skip to content

Commit 158eebc

Browse files
LeonLegionValentinH
authored andcommitted
using with browserify (#436)
Angular doesn't seem to support CommonJS.
1 parent c39e7e7 commit 158eebc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rzslider.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
// only CommonJS-like environments that support module.exports,
2020
// like Node.
2121
// to support bundler like browserify
22-
module.exports = factory(require('angular'));
22+
var angularObj = require('angular');
23+
if ((!angularObj || !angularObj.module) && typeof angular != 'undefined') {
24+
angularObj = angular;
25+
}
26+
module.exports = factory(angularObj);
2327
} else {
2428
// Browser globals (root is window)
2529
factory(root.angular);

0 commit comments

Comments
 (0)