我可以访问console.log($stateParams)
,但我无法访问其中的属性,例如console.log($stateParams.pageNo)
,如屏幕截图所示。
代码:
admin.controller('adminCtrl', function($scope, adminService, $s tateParams, $state) {
$scope.toggleSideBar = true;
$scope.serviceData = adminService;
console.log("Accessing $stateParams");
console.log($stateParams);
console.log("Accessing $stateParams.pageNo");
console.log($stateParams.pageNo);
$scope.handlePage = function(pageNo) {
$scope.serviceData.page = pageNo;
$scope.serviceData.paginate();
};
});