Skip to content

Commit 5beadb7

Browse files
committed
UMD support
1 parent 8cf1011 commit 5beadb7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/ng-xslt.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
(function () {
1+
(function (factory) {
2+
if (typeof define === 'function' && define.amd) {
3+
return define(['angular'], function (angular) {
4+
return factory(angular);
5+
});
6+
} else if (typeof exports === 'object') {
7+
return module.exports = factory(require('angular')).name;
8+
} else {
9+
return factory(angular);
10+
}
11+
})(function (angular) {
212
/**
313
* Returns whether the browser supports XSLT.
414
*
@@ -88,10 +98,10 @@
8898
return output || '(empty)';
8999
}
90100

91-
angular.module('ngXslt', [])
101+
return angular.module('ngXslt', [])
92102
.filter('xslt', [
93103
'$window', '$document',
94104
function ($window, $document) {
95105
return transformXml.bind(this, $window, $document[0]);
96106
}]);
97-
})();
107+
});

0 commit comments

Comments
 (0)