I found half of the answer to my problem in the accepted answer on this post. How do I filter an array with AngularJS and use a property of the filtered object as the ng-model attribute?
I wondered if it was possible to filter by another field that would create an array of those objects, then use values from two different objects in that array.
something like this... (the td with ng-show="data.Options.HasMap")
<tbody>
<tr ng-repeat="row in data.Rows">
<td ng-repeat="col in row.Columns" ng-show="{{col.Visible}}">
{{ col.Value }}
</td>
<td ng-show="data.Options.HasMap" ng-repeat="hidden in row.Columns | filter:{Visible:false} track by $index">
{{hidden.Value | filter:{HeaderText:'Latitude'}}} , {{hidden.Value | filter:{HeaderText:'Longitude'}}}
</td>
<td ng-show="data.Options.HasSuppression">
</td>
<td ng-show="data.Options.HasAction">
</td>
</tr>
</tbody>
my Json file has an array of columns like...
"Columns": [{
"HeaderText": "R1 - F1",
"Value": "data1",
"Visible": true
},...
and i would like to pull the columns out where Visible: false then pick out the Values of two different Objects with specific HeaderTexts.
Sorry if this sounds confusing. any help would be appreciated. I'm very new to Angular and just trying to figure things out!
edit. Just to point out that i can get to one of the column object i need like this.
<td ng-show="data.Options.HasMap" ng-repeat="hidden in row.Columns | filter:{HeaderText:'Latitude'} track by $index"> {{ hidden.Value }} </td>
But i really need both the Latitude and Longitude column objects to create a url with querystring variables.
i have also tried...
<td ng-show="data.Options.HasMap">
{{ row.Columns.Value | filter:{HeaderText:'Latitude'} }} , {{ row.Columns.Value | filter:{HeaderText:'Longitude'} }}
</td>