사람이 나는 상태에 제출 얼마나 많은 알고 싶어 JSON 아래에서 상태 필드각도에서 JSON에서 특정 값 JS
의 수를지고 나를 도와 줄 수 = 열기 및 폐쇄 및 할당
내가 URL에서 JSON 값을 얻고 그것을 JSON 데이터 아래
var app = angular.module('defectApp', ["ngTable"]);
app.controller('defectController', [
'$scope',
'$http',
function($scope, $http) {
$http({method: 'POST', url: '/angular/defect/defect.json'}).success(function(response) {
$scope.post = response;
})
},
]);
을 포함하고 여기에 (Anular JS에서
각도 JS를 값을 얻을 수있는 방법
JSON 데이터는
{
"data": [
{
"type": "defect",
"id": 1,
"user-01": "John",
"status": "Open",
"severity": "1 - Urgent"
},
{
"type": "defect",
"id": 2,
"user-01": "John",
"status": "Open",
"severity": "3 - High"
},
{
"type": "defect",
"id": 3,
"user-01": "John",
"status": "Assigned",
"severity": "3 - High"
},
{
"type": "defect",
"id": 4,
"user-01": "John",
"status": "Closed",
"severity": "4 - Medium"
},
{
"type": "defect",
"id": 5,
"user-01": "John",
"status": "Closed",
"severity": "4 - Medium"
}
]
}
[배열의 일부 속성이있는 항목 수 얻기] 가능한 복제본 (http://stackoverflow.com/questions/15360256/get-count-of-items-with-some-property-in-an-array)) – manzapanza
@manzapanza 여기 JSON 데이터에서 이러한 종류의 질문을 수행했습니다. 많은 필드가 있습니다. 함수가 Status = Count 등의 수치를 처리해야하는 방법이 있습니까? – Batman