diff --git a/src/scripts/04-controller.js b/src/scripts/04-controller.js index 78373b9a..90822cfc 100644 --- a/src/scripts/04-controller.js +++ b/src/scripts/04-controller.js @@ -73,19 +73,24 @@ function($scope, NgTableParams, $timeout, $parse, $compile, $attrs, $element, ng }; $element.addClass('ng-table'); var headerTemplate = null; + var HidePage=$parse($attrs.ngTable)($scope).$params.footer; // Elvin 增加显示 分页显示 true if ($element.find('> thead').length === 0) { headerTemplate = angular.element(document.createElement('thead')).attr('ng-include', 'templates.header'); $element.prepend(headerTemplate); } + if (HidePage) { var paginationTemplate = angular.element(document.createElement('div')).attr({ 'ng-table-pagination': 'params', 'template-url': 'templates.pagination' }); + } $element.after(paginationTemplate); if (headerTemplate) { $compile(headerTemplate)($scope); } + if (HidePage) { $compile(paginationTemplate)($scope); + } } }; @@ -189,10 +194,10 @@ app.factory('ngTableColumn', [function () { filter: function(){ return false; }, filterData: angular.noop, headerTemplateURL: function(){ return false; }, - headerTitle: function(){ return ' '; }, + headerTitle: function(){ return ''; }, sortable: function(){ return false; }, show: function(){ return true; }, - title: function(){ return ' '; }, + title: function(){ return ''; }, titleAlt: function(){ return ''; } }; @@ -242,4 +247,4 @@ app.factory('ngTableColumn', [function () { return { buildColumn: buildColumn }; -}]); \ No newline at end of file +}]);