             if $scope.descending then "icon-chevron-down" else "icon-chevron-up"
 
           $scope.fromPage = () ->
-            if $scope[paginationName]
-              $scope[paginationName].fromPage()
-            else
-              $scope.list.length
+            if $scope[paginationName] then $scope[paginationName].fromPage() else $scope.list.length
 
           $scope.toPage = () ->
-            if $scope[paginationName]
-              $scope[paginationName].itemsPerPage
-            else
-              $scope.list.length
+            if $scope[paginationName] then $scope[paginationName].itemsPerPage else $scope.list.length
       }
   }
 ]

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

      $scope.stub.list = $scope.list

      $scope.stub.itemsPerPage = $scope.itemsPerPage

      $scope.stub.currentPage = 0

      $scope.update = () ->

        $scope.stub.itemsPerPage * $scope.stub.currentPage - $scope.list.length

      $scope.goToPage = (page) ->
        page = Math.max(0, page)
        page = Math.min($scope.stub.numberOfPages - 1, page)

        $scope.stub.currentPage = page

      $scope.update()

      $scope.$watch "list", () ->
        $scope.update()
  }
