I have an array of objects in my controller, for example:
$scope.fields = [
{fieldName:'houseNum',fieldLabel:'House Number',disabled:false},
{fieldName:'street',fieldLabel:'Street',disabled:false},
{fieldName:'city',fieldLabel:'City',disabled:true},
{fieldName:'state',fieldLabel:'State',disabled:true},
]
In HTML, I would like to get the field fieldLabel, where fieldName == 'street'. The AJS documentation assumes that each filter case should be in the ng-repeat context - but not so in my case, as I am just trying to tear out one "fieldLabel" from the "fields" array based on "fieldName"
for example: HTML
{{ fieldLabel in fields | filter : {fieldName:'street'} : true}}
How can I do something like this work - or do I need to create my own directive and pass the $ scope.fields to the directive and execute the loop manually?
source
share