@@ -692,10 +692,11 @@ app.factory('ngTableColumn', [function () {
692
692
filter : function ( ) { return false ; } ,
693
693
filterData : angular . noop ,
694
694
headerTemplateURL : function ( ) { return false ; } ,
695
- headerTitle : function ( ) { return ' ' ; } ,
695
+ headerTitle : function ( ) { return '' ; } ,
696
+ sortIndicator : function ( ) { return 'div' ; } ,
696
697
sortable : function ( ) { return false ; } ,
697
698
show : function ( ) { return true ; } ,
698
- title : function ( ) { return ' ' ; } ,
699
+ title : function ( ) { return '' ; } ,
699
700
titleAlt : function ( ) { return '' ; }
700
701
} ;
701
702
@@ -746,6 +747,7 @@ app.factory('ngTableColumn', [function () {
746
747
buildColumn : buildColumn
747
748
} ;
748
749
} ] ) ;
750
+
749
751
/**
750
752
* ngTable: Table + Angular JS
751
753
*
@@ -798,6 +800,7 @@ app.directive('ngTable', ['$q', '$parse',
798
800
799
801
var parsedAttribute = function ( attr ) {
800
802
var expr = getAttrValue ( attr ) ;
803
+ console . log ( expr ) ;
801
804
if ( ! expr ) {
802
805
return undefined ;
803
806
}
@@ -814,11 +817,14 @@ app.directive('ngTable', ['$q', '$parse',
814
817
}
815
818
// NOTE TO MAINTAINERS: if you add extra fields to a $column be sure to extend ngTableColumn with
816
819
// a corresponding "safe" default
820
+
821
+
817
822
columns . push ( {
818
823
id : i ++ ,
819
824
title : parsedAttribute ( 'title' ) ,
820
825
titleAlt : parsedAttribute ( 'title-alt' ) ,
821
826
headerTitle : parsedAttribute ( 'header-title' ) ,
827
+ sortIndicator : parsedAttribute ( 'sort-indicator' ) ,
822
828
sortable : parsedAttribute ( 'sortable' ) ,
823
829
'class' : parsedAttribute ( 'header-class' ) ,
824
830
filter : parsedAttribute ( 'filter' ) ,
@@ -828,6 +834,7 @@ app.directive('ngTable', ['$q', '$parse',
828
834
return $parse ( el . attr ( "ng-show" ) ) ( scope ) ;
829
835
} : undefined )
830
836
} ) ;
837
+
831
838
} ) ;
832
839
return function ( scope , element , attrs , controller ) {
833
840
scope . $columns = columns = controller . buildColumns ( columns ) ;
@@ -912,6 +919,7 @@ app.directive('ngTableDynamic', ['$parse', function ($parse){
912
919
}
913
920
} ;
914
921
} ] ) ;
922
+
915
923
/**
916
924
* ngTable: Table + Angular JS
917
925
*
@@ -961,7 +969,7 @@ angular.module('ngTable').run(['$templateCache', function ($templateCache) {
961
969
$templateCache . put ( 'ng-table/filters/select-multiple.html' , '<select ng-options="data.id as data.title for data in $column.data" ng-disabled="$filterRow.disabled" multiple ng-multiple="true" ng-model="params.filter()[name]" ng-show="filter==\'select-multiple\'" class="filter filter-select-multiple form-control" name="{{name}}"> </select>' ) ;
962
970
$templateCache . put ( 'ng-table/filters/select.html' , '<select ng-options="data.id as data.title for data in $column.data" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" ng-show="filter==\'select\'" class="filter filter-select form-control" name="{{name}}"> </select>' ) ;
963
971
$templateCache . put ( 'ng-table/filters/text.html' , '<input type="text" name="{{name}}" ng-disabled="$filterRow.disabled" ng-model="params.filter()[name]" ng-if="filter==\'text\'" class="input-filter form-control"/>' ) ;
964
- $templateCache . put ( 'ng-table/header.html' , '<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-show="$column.show(this)" ng-init="template=$column.headerTemplateURL(this)" class="header {{$column.class(this)}}"> <div ng-if="!template" ng-show="!template" ng-bind="$column.title(this)"></div> <div ng-if="template" ng-show="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-show="$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> ' ) ;
972
+ $templateCache . put ( 'ng-table/header.html' , '<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-show="$column.show(this)" ng-init="template=$column.headerTemplateURL(this)" class="header {{$column.class(this)}}"> <div ng-if="!template" ng-show="!template" class="ng-table-header" ng-class="{\'sort-indicator\': $column.sortIndicator(this)==\'div\'}"> <span ng-bind="$column.title(this)" ng-class="{\'sort-indicator\': $column.sortIndicator(this)==\'span\'}"></span> </div> <div ng-if="template" ng-show="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-show="$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> ' ) ;
965
973
$templateCache . put ( 'ng-table/pager.html' , '<div class="ng-cloak ng-table-pager" ng-if="params.data.length"> <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 && !page.current, \'active\': page.current}" ng-repeat="page in pages" ng-switch="page.type"> <a ng-switch-when="prev" ng-click="params.page(page.number)" href="">«</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="">…</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="">»</a> </li> </ul> </div> ' ) ;
966
974
} ] ) ;
967
975
return app ;
0 commit comments