Get value from complex array variable


#1

Hello,

I'm trying to retrieve the birthday and gender from this array. I was able to get values like title and userid but other fields like gender and birthday values. Can this be done via filter or expression? Please help.

<div ng-repeat="item in items" ng-controller="FriendItemCtrl" >

  iUserId: {{item.iUserId}}<br>
  Title: {{item.sTitle}}<br>
  Birthday: {{item.sTitle | ?}}
  Gender: {{item.sTitle | ?}}

</div>

Array Variable :

[
  {


    "iUserId": 3,
    "sTitle": "Red Horse  Beer",
    "profile": {
      "0": {
        "field_id": 3,
        "type": "first_name",
        "label": "First Name",
        "required": 1,
        "current_id": 0,
        "current_value": "Red Horse ",
        "options": []
      },
      "1": {
        "field_id": 4,
        "type": "last_name",
        "label": "Last Name",
        "required": 1,
        "current_id": 0,
        "current_value": "Beer",
        "options": []
      },
      "2": {
        "field_id": 5,
        "type": "gender",
        "label": "Gender",
        "required": 1,
        "current_id": 2,
        "current_value": "Male",
        "options": [
          {
            "id": 2,
            "label": "Male"
          },
          {
            "id": 3,
            "label": "Female"
          }
        ]
      },
      "3": {
        "field_id": 6,
        "type": "birthdate",
        "label": "Birthday",
        "required": 1,
        "current_id": 0,
        "current_value": "2004-1-1",
        "options": []
      },
      "4": {
        "field_id": 13,
        "type": "about_me",
        "label": "About Me",
        "required": 0,
        "current_id": 0,
        "current_value": "",
        "options": []
      },
      "5": {
        "field_id": 9,
        "type": "multi_checkbox",
        "label": "Genre",
        "required": 1,
        "current_id": 0,
        "current_value": null,
        "options": [
          {
            "id": 57,
            "label": "Acoustic"
          },
          {
            "id": 59,
            "label": "Blues"
          },
          {
            "id": 61,
            "label": "Dance"
          },
          {
            "id": 63,
            "label": "Electronic"
          },
          {
            "id": 65,
            "label": "Folk"
          },
          {
            "id": 67,
            "label": "Grunge"
          },
          {
            "id": 69,
            "label": "Hardcore"
          },
          {
            "id": 89,
            "label": "Soul"
          },
          {
            "id": 87,
            "label": "Rock"
          },
          {
            "id": 85,
            "label": "Punk"
          },
          {
            "id": 83,
            "label": "Pop"
          },
          {
            "id": 81,
            "label": "Reggae"
          },
          {
            "id": 79,
            "label": "R&B"
          },
          {
            "id": 77,
            "label": "Metal"
          },
          {
            "id": 75,
            "label": "Jazz"
          },
          {
            "id": 73,
            "label": "Instrumental"
          },
          {
            "id": 71,
            "label": "Hip Hop"
          },
          {
            "id": 91,
            "label": "Ska"
          },
          {
            "id": 93,
            "label": "World"
          }
        ]
      },
      "6": {
        "field_id": 8,
        "type": "text",
        "label": "GPS",
        "required": 1,
        "current_id": 0,
        "current_value": "",
        "options": []
      },
      "id": 3
    },
  },
  {
    "iUserId": 329,
    "sTitle": "Vijae Manlapaz",
    "profile": {
      "0": {
        "field_id": 3,
        "type": "first_name",
        "label": "First Name",
        "required": 1,
        "current_id": 0,
        "current_value": "Vijae",
        "options": []
      },
      "1": {
        "field_id": 4,
        "type": "last_name",
        "label": "Last Name",
        "required": 1,
        "current_id": 0,
        "current_value": "Manlapaz",
        "options": []
      },
      "2": {
        "field_id": 5,
        "type": "gender",
        "label": "Gender",
        "required": 1,
        "current_id": 3,
        "current_value": "Female",
        "options": [
          {
            "id": 2,
            "label": "Male"
          },
          {
            "id": 3,
            "label": "Female"
          }
        ]
      },
      "3": {
        "field_id": 6,
        "type": "birthdate",
        "label": "Birthday",
        "required": 1,
        "current_id": 0,
        "current_value": "1988-11-01",
        "options": []
      },
      "4": {
        "field_id": 8,
        "type": "text",
        "label": "GPS",
        "required": 1,
        "current_id": 0,
        "current_value": "0:8:332:332",
        "options": []
      },
      "id": 329
    },
  }
]

#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.