-
Notifications
You must be signed in to change notification settings - Fork 851
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(header.html): split template into directives
New directives and controllers created: * `ngTableFilterRow` directive paired with `ngTableFilterRowController` * `ngTableSorterRow` directive paired with `ngTableSorterRowController` BREAKING CHANGE: The sortBy function previously declared by `ngTableController` has been moved to the new controller - `ngTableSorterRowController`.
- Loading branch information
1 parent
e563ecd
commit 47460d6
Showing
5 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<tr ng-show="show_filter" class="ng-table-filters"> | ||
<th data-title-text="{{$column.titleAlt(this) || $column.title(this)}}" ng-repeat="$column in $columns" ng-if="$column.show(this)" class="filter"> | ||
<div ng-repeat="(name, filter) in $column.filter(this)"> | ||
<div ng-if="filter.indexOf('/') !== -1" ng-include="filter"></div> | ||
<div ng-if="filter.indexOf('/') === -1" ng-include="'ng-table/filters/' + filter + '.html'"></div> | ||
</div> | ||
</th> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,2 @@ | ||
<tr> | ||
<th title="{{$column.headerTitle(this)}}" | ||
ng-repeat="$column in $columns" | ||
ng-class="{ | ||
'sortable': $column.sortable(this), | ||
'sort-asc': params.sorting()[$column.sortable(this)]=='asc', | ||
'sort-desc': params.sorting()[$column.sortable(this)]=='desc' | ||
}" | ||
ng-click="sortBy($column, $event)" | ||
ng-if="$column.show(this)" | ||
ng-init="template = $column.headerTemplateURL(this)" | ||
class="header {{$column.class(this)}}"> | ||
<div ng-if="!template" class="ng-table-header" ng-class="{'sort-indicator': params.settings().sortingIndicator == 'div'}"> | ||
<span ng-bind="$column.title(this)" ng-class="{'sort-indicator': params.settings().sortingIndicator == 'span'}"></span> | ||
</div> | ||
<div ng-if="template" ng-include="template"></div> | ||
</th> | ||
</tr> | ||
<tr ng-show="show_filter" class="ng-table-filters"> | ||
<th data-title-text="{{$column.titleAlt(this) || $column.title(this)}}" ng-repeat="$column in $columns" ng-if="$column.show(this)" class="filter"> | ||
<div ng-repeat="(name, filter) in $column.filter(this)"> | ||
<div ng-if="filter.indexOf('/') !== -1" ng-include="filter"></div> | ||
<div ng-if="filter.indexOf('/') === -1" ng-include="'ng-table/filters/' + filter + '.html'"></div> | ||
</div> | ||
</th> | ||
</tr> | ||
<ng-table-sorter-row></ng-table-sorter-row> | ||
<ng-table-filter-row></ng-table-filter-row> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<tr> | ||
<th title="{{$column.headerTitle(this)}}" | ||
ng-repeat="$column in $columns" | ||
ng-class="{ | ||
'sortable': $column.sortable(this), | ||
'sort-asc': params.sorting()[$column.sortable(this)]=='asc', | ||
'sort-desc': params.sorting()[$column.sortable(this)]=='desc' | ||
}" | ||
ng-click="sortBy($column, $event)" | ||
ng-if="$column.show(this)" | ||
ng-init="template = $column.headerTemplateURL(this)" | ||
class="header {{$column.class(this)}}"> | ||
<div ng-if="!template" class="ng-table-header" ng-class="{'sort-indicator': params.settings().sortingIndicator == 'div'}"> | ||
<span ng-bind="$column.title(this)" ng-class="{'sort-indicator': params.settings().sortingIndicator == 'span'}"></span> | ||
</div> | ||
<div ng-if="template" ng-include="template"></div> | ||
</th> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters