Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 04-controller.js #555

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/scripts/04-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
};

Expand Down Expand Up @@ -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 ''; }
};

Expand Down Expand Up @@ -242,4 +247,4 @@ app.factory('ngTableColumn', [function () {
return {
buildColumn: buildColumn
};
}]);
}]);