My code successfully retrieves JSON responses from the server.
Here is the Javascript Code :
$http({
method: 'POST',
url: 'http://***SOMEURL',
headers: { 'Content-Type': 'application/json', 'Accept': 'application/json'},
data: JSON.stringify(data)
})
.then(function (response) {
$scope.myData = response.data;
$scope.myData1=response.data.message.connectionDetailses;
});
The response returned is as follows:
{
"code": 100,
"message": {
"id": 29020,
"customerCode": "730",
"name": "John P. M. 168",
"lastName": "X",
"houseName": "Hosuseahjkahsh",
"address1": "1",
"address2": "x",
"address3": "wehwhkjwh P. O.",
"postalCode": "686011",
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9aababdaababb4f9f5f7">[email protected]</a>",
"phone": "1234567890",
"mobile": "1234567890",
"operatorName": "abcd ",
"connectionDetailses": [
{
"customerCode": "730",
"accountId": 5,
"dueAmount": 0,
"connectionId": 27203,
"accountName": "M S"
},
{
"customerCode": "730",
"accountId": 5,
"dueAmount": 2000,
"connectionId": 116303,
"accountName": "MS"
},
{
"customerCode": "730",
"accountId": 9,
"dueAmount": 0,
"connectionId": 116303,
"accountName": "Connection"
},
{
"customerCode": "730",
"accountId": 14,
"dueAmount": 0,
"connectionId": 116303,
"accountName": "Amc"
}
]
}
}
I am looking to display connection details based on connectionId within a single block, instead of all at once.
{
"customerCode": "730",
"accountId": 9,
"dueAmount": 0,
"connectionId": 116303,
"accountName": "Connection"
}