I'm doing a pagination directive for my results and I can't seem to get over this problem. I have the following code (coffeescript):
window.pagination_services = angular.module("pagination_services", [])
.directive('paginate', ->
{
restrict: 'E',
replace: true,
templateUrl: '../../assets/app/partials/services/pagination.html',
scope: true,
link: ($scope, $element, $attrs) ->
console.log $scope.results
}
)
As you can see I have a console.log on $scope.results which returns:
e
pagination: Object
current_page: 1
per_page: 20
total_entries: 4097
__proto__: Object
sales: Array[20]
__proto__: e
I need to be able to access the value of that pagination object. Something like:
$scope.results.pagination.current_page
but, no matter what I try, I get undefined.
Any ideas?