I have list of objects where I have to filter the objects based on value of a key present inside same object and create <div>
tag with content.
List of objects:
{
"statusCode" : 200,
"statusMessage" : "OK",
"result" : [
{
"owner" : {
"id" : "3f32ce2f-4300-439b-84bc-92ad46fbccf7"
},
"name" : "Test 12345",
"description" : "Test 12345",
"created_at" : 1465222538,
"active" : "true",
"id" : "2ade9236-c382-400c-9c0b-94e96db9b2aa",
"status" : "OPEN"
}, {
"owner" : {
"id" : "3f32ce2f-4300-439b-84bc-92ad46fbccf7"
},
"name" : "sample2",
"description" : "sample2",
"created_at" : 1465117865,
"active" : "true",
"id" : "8bf206f9-d3e0-43f4-ba3f-f71c88db9b0e",
"status" : "IN PROGRESS"
},
]
}
I want to filter data based on "status" : "IN PROGRESS"
or "status" : "OPEN"
and show the data inside <li>
tag but the thing is identifier(key) is present inside the same object. How do I achieve this in angularjs or vanilla javascript?
For now I am looping using ng-repeat to create and show data in <li>
:
<div>
<ul>
<li ng-repeat="wd in currentPageWorkOrders>
<a ng-click="viewProject(wd)" href="">
<h4>{{wd.name}}</h4>
</a>
<p>Publisher Name</p>
</li>
</ul>
</div>