Answer the question
In order to leave comments, you need to log in
How to count the number of defined values in an angular model?
Good afternoon.
There is data like
[{name:'John', phone:'555',myvalue:1},{name:'Mary', phone:'800',myvalue:0}, etc.
How to count the number of defined values in an angular model where myvalue=0 ?
Thanks
Answer the question
In order to leave comments, you need to log in
https://docs.angularjs.org/api/ng/function/angular... ;)
$scope.count_true = 0;
$scope.count_false = 0;
$scope.count_study = 0;
$.each($scope.SpisokVoprosov, function(index, value){
if(value.reshenie==="1"){$scope.count_true++;}
if(value.reshenie==="0"){$scope .count_false++;}
if(value.reshenie===""){$scope.count_study++;}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question