I have the following angular object in my controller
$scope.students = [{:id => 1, :state => 'active'}, {:id => 2, :state => 'suspended'}]
How can i get id of all students whose state is active? Can anyone please help me with this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is multiple ways but the easiest I can think of is adding an activeStudent function in your scope, something like this:
and in your views you would use activeStudent() in your binding.