How can I populate an array of objects with data using ng-repeat
for a specific id in AngularJS version 1.4?
{
"tagTypeDetails": [
{
"id": 3,
"type": "Project Type",
"Tags": [
{"id": 21, "name": "Residential"},
{"id": 22, "name": "Office"},
{"id": 23, "name": "Retail"},
{"id": 24, "name": "Hospitality"}
]
},
...
]
}
In my HTML view, I want to display all the 'Tags' name related to a particular label field based on a specific id.
Currently, I am retrieving Tags names for all ids.
Example :
<label for="type" class="col-sm-2">Project type</label>
<div class="col-sm-8" ng-repeat="tags in addProjectVm.tagsData">
<label ng-repeat="tag in tags.Tags">
//here all Tags name are getting displayed.. //i want specific for type="Project Type" only
<input type="checkbox" name="project" id="{{tag.id}}" value="{{tag.name}}"> {{tag.name}}
</label>
</div>
I would really appreciate the best possible solutions as I currently have an alternative that is not considered best practice.