if i have simple object like this:
$scope.results = {
year:2021,
subjects:[
{title:'English',grade:'A'},
{title:'Maths',grade:'A'},
{title:'Science',grade:'B'},
{title:'Geography',grade:'C'}
]
};
IT IS NO PROBLEM to get value using filter, like here
$scope.gradeC = $filter('filter')($scope.results.subjects, {grade: 'C'})[0];
or count it :
$scope.gradeA = $filter('filter')($scope.results.subjects, {grade: 'A'}).length;
BUT, if i have something like this:
$scope.results = {
year:2021,
subjects:[
{title:'English',grade:''},
{title:'Maths',grade:''},
{title:'Science',grade:''},
{title:'Geography',grade:'{
_someDate : 'Nov 19, 2024'
}'}
]
};
how could i to count how much values in grade with empty string i have and how much with some Object as value?