Skip to content

Commit

Permalink
UMD support
Browse files Browse the repository at this point in the history
  • Loading branch information
v12 committed Jun 16, 2015
1 parent 8cf1011 commit 5beadb7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/ng-xslt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
(function () {
(function (factory) {
if (typeof define === 'function' && define.amd) {
return define(['angular'], function (angular) {
return factory(angular);
});
} else if (typeof exports === 'object') {
return module.exports = factory(require('angular')).name;
} else {
return factory(angular);
}
})(function (angular) {
/**
* Returns whether the browser supports XSLT.
*
Expand Down Expand Up @@ -88,10 +98,10 @@
return output || '(empty)';
}

angular.module('ngXslt', [])
return angular.module('ngXslt', [])
.filter('xslt', [
'$window', '$document',
function ($window, $document) {
return transformXml.bind(this, $window, $document[0]);
}]);
})();
});

0 comments on commit 5beadb7

Please # to comment.