Browse Source

#195: + amd

requirejs
RubaXa 10 years ago
parent
commit
bb09bb423a
  1. 18
      ng-sortable.js

18
ng-sortable.js

@ -2,11 +2,21 @@
* @author RubaXa <trash@rubaxa.org> * @author RubaXa <trash@rubaxa.org>
* @licence MIT * @licence MIT
*/ */
(function (factory) {
'use strict';
if (window.angular && window.Sortable) {
factory(angular, Sortable);
}
else if (typeof define === 'function' && define.amd) {
define(['angular', 'sortable'], factory);
}
})(function (angular, Sortable) {
'use strict';
angular.module('ng-sortable', []) angular.module('ng-sortable', [])
.constant('$version', '0.3.2') .constant('$version', '0.3.2')
.directive('ngSortable', ['$parse', function ($parse) { .directive('ngSortable', ['$parse', function ($parse) {
'use strict';
var removed; var removed;
function getSource(el) { function getSource(el) {
@ -116,5 +126,5 @@ angular.module('ng-sortable', [])
} }
} }
}; };
}]) }]);
; });

Loading…
Cancel
Save