Skip to content

Commit 81d5795

Browse files
committed
AMD definition fix
"angular || null" will return an error if angular is not defined, not null as expected this change makes ng-table compatible with requireJS (bug appeared when ng-table was loaded before angular, that can happen at random)
1 parent 93b4846 commit 81d5795

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ng-table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
} else {
99
return factory(angular);
1010
}
11-
}(angular || null, function(angular) {
11+
}(typeof(angular) === 'undefined' ? null : angular, function(angular) {
1212
'use strict';
1313
/**
1414
* ngTable: Table + Angular JS
@@ -719,4 +719,4 @@ angular.module('ngTable').run(['$templateCache', function ($templateCache) {
719719
$templateCache.put('ng-table/pager.html', '<div class="ng-cloak ng-table-pager"> <div ng-if="params.settings().counts.length" class="ng-table-counts btn-group pull-right"> <button ng-repeat="count in params.settings().counts" type="button" ng-class="{\'active\':params.count()==count}" ng-click="params.count(count)" class="btn btn-default"> <span ng-bind="count"></span> </button> </div> <ul class="pagination ng-table-pagination"> <li ng-class="{\'disabled\': !page.active}" ng-repeat="page in pages" ng-switch="page.type"> <a ng-switch-when="prev" ng-click="params.page(page.number)" href="">&laquo;</a> <a ng-switch-when="first" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="page" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="more" ng-click="params.page(page.number)" href="">&#8230;</a> <a ng-switch-when="last" ng-click="params.page(page.number)" href=""><span ng-bind="page.number"></span></a> <a ng-switch-when="next" ng-click="params.page(page.number)" href="">&raquo;</a> </li> </ul> </div> ');
720720
}]);
721721
return app;
722-
}));
722+
}));

0 commit comments

Comments
 (0)