I'm having two Collection user and Type. I wish to dispay Email ID which is marked as IsPreffered = TRUE and I need to map the email.Type to Type.ID
{ "user" : [
{
"Name" : "B. Balamanigandan",
"Email": [
{
"Id": "[email protected]",
"IsPreffered": true,
"Type": 1,
},
{
"Id": "[email protected]",
"IsPreffered": false,
"Type": 2,
}
]}
]};
{
"Type": [
{
"ID": 1,
"Name": "Private"
},
{
"ID": 2,
"Name": "Home"
},
{
"ID": 3,
"Name": "Business"
},
]}
HTML Source Code:
<span ng-repeat="email in collection.user[0].Email | filter: {IsPreffered : true} " ng-if="$last"> {{email.Id}}</span>
Here I need to Specify the Type "Private" for the above HTML. How to Map the user[0].Email.Type to Type.ID and fetch the appropriate Type.Name
Kindly filter the condition using HTML Level not in JavaScript Level. Kindly assist me.