Skip to content

Commit b5a0db8

Browse files
committed
CommonJS compliance
1 parent 2ea80a4 commit b5a0db8

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

app/js/timer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('timer', [])
1+
var timerModule = angular.module('timer', [])
22
.directive('timer', ['$compile', function ($compile) {
33
return {
44
restrict: 'EAC',
@@ -246,3 +246,8 @@ angular.module('timer', [])
246246
}]
247247
};
248248
}]);
249+
250+
/* commonjs package manager support (eg componentjs) */
251+
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
252+
module.exports = timerModule;
253+
}

dist/angular-timer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* angular-timer - v1.1.3 - 2014-05-19 11:08 PM
2+
* angular-timer - v1.1.3 - 2014-05-21 5:58 PM
33
* https://github.com/siddii/angular-timer
44
*
55
* Copyright (c) 2014 Siddique Hameed
66
* Licensed MIT <https://github.com/siddii/angular-timer/blob/master/LICENSE.txt>
77
*/
8-
angular.module('timer', [])
8+
var timerModule = angular.module('timer', [])
99
.directive('timer', ['$compile', function ($compile) {
1010
return {
1111
restrict: 'EAC',
@@ -253,3 +253,8 @@ angular.module('timer', [])
253253
}]
254254
};
255255
}]);
256+
257+
/* commonjs package manager support (eg componentjs) */
258+
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
259+
module.exports = timerModule;
260+
}

dist/angular-timer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"name": "angular-timer",
44
"version": "1.1.3",
55
"homepage": "https://github.com/siddii/angular-timer",
6+
"main":"dist/angular-timer.js",
67
"licenses": {
78
"type": "MIT",
89
"url": "https://github.com/siddii/angular-timer/blob/master/LICENSE.txt"

0 commit comments

Comments
 (0)