我正在使用 AngularJS,并且我调用了 $resource 来获取单个值(例如,获取获取到 14)。
以下在我的控制器中:
var MaxCount = $resource('/maxquestion/fetch', null,
{
getMaxQuestionCount: {method: 'GET', isArray: false}
});
$scope.maxQuestionCount = MaxCount.getMaxQuestionCount();
现在我正在尝试$scope.maxQuestionCount在控制器中使用,doing $scope.maxQuestionCount[0]give me 1and $scope.maxQuestionCount[1]give me4
console.log($scope.maxQuestionCount)我[object Object]
console.dir($scope.maxQuestionCount)我There are no child objects
我很困惑。如何访问值 14?