From c69d91f3e548a6bc842c7df5f5288797829e1d21 Mon Sep 17 00:00:00 2001 From: Aron Podrigal Date: Fri, 1 Apr 2016 18:04:33 -0400 Subject: [PATCH] commonjs package manager support --- angular-ui-switch.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/angular-ui-switch.js b/angular-ui-switch.js index 9a6b591..8703dda 100644 --- a/angular-ui-switch.js +++ b/angular-ui-switch.js @@ -1,3 +1,10 @@ +/* commonjs package manager support (eg componentjs) */ +if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){ + module.exports = 'uiSwitch'; +} + +var angular = require('angular'); + angular.module('uiSwitch', []) .directive('switch', function(){