I'm facing a challenge with parsing two JSON format data and displaying them in Angular. I'm unsure of how to proceed and need guidance. The second data includes a plan_id that refers to the "plan" data. How can I create a small lookup object to match the "plan" using the plan_id? The JSON files and my index are provided below:
{
"plans":[
{
"id":1,
"code":"NEXT_DAY_500gm",
"name":"Next Day less than 500gm",
"cost":55,
"duration":24,
"min_weight":0,
"max_weight":500,
"COD":1,
"created_at":"-0001-11-30 00:00:00",
"updated_at":"-0001-11-30 00:00:00"
},
...
]
}
[{
"id":23,"sender_id":3,"courier_id":0,"deliverer_id":0,"status":"PENDING",...,"plan_id":2,...},
...
]
index.html
<!DOCTYPE HTML>
<html>
<head>
<title>Reports </title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
</head>
<body ng-app="reportApp" ng-controller="mainCtrl">
<table>
</table>
</body>
I'm stuck on how to proceed. Any advice on parsing and displaying the JSON data in Angular would be greatly appreciated. Thank you for your help!