結果に対してページネーション ディレクティブを実行していますが、この問題を解決できないようです。私は次のコード(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
}
)
ご覧のとおり、次$scope.results
を返すconsole.log があります。
e
pagination: Object
current_page: 1
per_page: 20
total_entries: 4097
__proto__: Object
sales: Array[20]
__proto__: e
そのページネーション オブジェクトの値にアクセスできる必要があります。何かのようなもの:
$scope.results.pagination.current_page
しかし、何を試しても未定義になります。
何か案は?