     restrict: "AC"
     scope: true
     compile: (element, attributes, transclude) ->
-
-
       paginationName = attributes.pagination
-
       listName = attributes.list || "#{paginationName}.list"
 
       constructHeader(element)
 
       tbody = element.find "tbody"
       tr = tbody.find "tr"
-
       tr.attr("ng-repeat", "item in #{listName} | limitTo:fromPage() | limitTo:toPage() | orderBy:predicate:descending")
-
       {
         post: ($scope, $element, $attributes) ->
 

    }
    link: ($scope, $element, $attributes) ->
      $scope.stub = {}

      $scope.stub.list = $scope.list

      $scope.stub.itemsPerPage = $scope.itemsPerPage

      $scope.stub.currentPage = 0

      $scope.update = () ->

            if $scope.descending then "icon-chevron-down" else "icon-chevron-up"

          $scope.fromPage = () ->
            if $scope[paginationName] then $scope[paginationName].fromPage() else $scope.list.length

          $scope.toPage = () ->
            if $scope[paginationName] then $scope[paginationName].itemsPerPage else $scope.list.length
      }
  }
]
