Browse Source

#195: + amd

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

20
ng-sortable.js

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

Loading…
Cancel
Save