Q:

Handling Json response in table

I have a JSON Response as follows
JSON :
 var res =    {
      "response": {
        "status": {
          "code": "0",
          "message": "Success"
        },
        "service": {
          "servicetype": "3",
          "functiontype": "3000",
          "session_id": "966"
        },
        "data": {
          "profilesearchsnippet": [
            {
              "profileInfo": {
                "firstname": "Archita",
                "lastname": "v",
                "gender": "female",
                "country": "India",

              }
            },

            {
              "profileInfo": {
                "firstname": "Archita",
                "lastname": "V",
                "gender": "female",
                "country": "India",

              }
            },

            {
              "profileInfo": {
                "firstname": "Jayasree",
                "lastname": "Salavadi",
                "gender": "female",
                "country": "Afghanistan",

              }
            },

            {
              "profileInfo": {
                "firstname": "Kalai",
                "lastname": "Sundar",
                "gender": "female",
                "country": "India",

              }
            },

            {
              "profileInfo": {
                "firstname": "Singer",
                "lastname": "sing",
                "gender": "female",
                "country": "Afghanistan",

              }
            }

          ]
        }
      }
    }

I want to fetch all firstname , country state city in a table.I tried assigning  profilesearchsnippet value to variable var SearchData and try fetching firstname by using profileinfo,since its object. I am missing  something somewhere need assistance.
HTML:
  <tr ng-repeat= "item in searchData">
        <td>{{searchData.profileInfo.firstname}}</td>
        <td> {{searchData.profileInfo.country}}</td>
      </tr>

JS:   
var searchData = res.response.data.profilesearchsnippet;

A:

1. Your JSON is not valid.

2. Inside ng-repeat use {{item.profileInfo.firstname}} instead of {{searchData.profileInfo.firstname}}.
Working demo :

var myApp = angular.module('myApp',[]);

myApp.controller('MyCtrl',function ($scope) {
    var res = {
 "response": {
  "status": {
   "code": "0",
   "message": "Success"
  },
  "service": {
   "servicetype": "3",
   "functiontype": "3000",
   "session_id": "966"
  },
  "data": {
   "profilesearchsnippet": [{
     "profileInfo": {
      "firstname": "Archita",
      "lastname": "v",
      "gender": "female",
      "country": "India"
     }
    },

    {
     "profileInfo": {
      "firstname": "Archita",
      "lastname": "V",
      "gender": "female",
      "country": "India"
     }
    },

    {
     "profileInfo": {
      "firstname": "Jayasree",
      "lastname": "Salavadi",
      "gender": "female",
      "country": "Afghanistan"
     }
    },

    {
     "profileInfo": {
      "firstname": "Kalai",
      "lastname": "Sundar",
      "gender": "female",
      "country": "India"
     }
    },

    {
     "profileInfo": {
      "firstname": "Singer",
      "lastname": "sing",
      "gender": "female",
      "country": "Afghanistan"
     }
    }

   ]
  }
 }
};

$scope.searchData = res.response.data.profilesearchsnippet;
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="MyCtrl">
  <table>
  <tr ng-repeat= "item in searchData">
        <td>{{item.profileInfo.firstname}}</td>
        <td> {{item.profileInfo.country}}</td>
      </tr>
  </table>
</div>

