OK, I solved it HERE
The JS code is as follows:
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.accountInfo = [
{
"id": "0",
"accountName": "Account A"
},
{
"id": "1",
"accountName": "Account B"
},
{
"id": "2",
"accountName": "Account C"
}
];
$scope.update = function(accounts) {
//console.log($scope.item.code, $scope.item.name);
//alert("change");
$scope.acctountDetails = [
{
"id": "0",
"accountName": "Account 1",
"principalAmount": "0.00",
"commission": "0.00",
"totalAmount": "0.00",
"description": [
"My IRA 1",
"Mellisa's IRA",
"BR Demo 1",
"BR Demo 2",
"BR Demo 3"
],
"cashAvailable": [
"278,800.33A",
"0.00",
"574.78",
"501,211.71",
"2,228.92"
],
"totalValue": [
"2,008,408.12A",
"36,373.44",
"574.78",
"501,211.71",
"2,228.92"
]
},
{
"id": "1",
"accountName": "Account 2",
"principalAmount": "0.00",
"commission": "0.00",
"totalAmount": "0.00",
"description": [
"My IRA 2222",
"Mellisa's IRA",
"BR Demo 4",
"BR Demo 5",
"BR Demo 6"
],
"cashAvailable": [
"278,800.33B",
"0.00",
"575.78",
"501,211.71",
"2,228.92"
],
"totalValue": [
"2,008,408.12B",
"36,373.44",
"575.78",
"501,211.71",
"2,228.92"
]
},
{
"id": "2",
"accountName": "Account 3",
"principalAmount": "70.00",
"commission": "0.00",
"totalAmount": "0.00",
"description": [
"My IRA 3",
"Mellisa's IRA",
"BR Demo 7",
"BR Demo 8",
"BR Demo 9"
],
"cashAvailable": [
"278,800.33C",
"0.00",
"576.78",
"501,211.71",
"2,228.92"
],
"totalValue": [
"2,008,408.12C",
"36,373.44",
"576.78",
"501,211.71",
"2,228.92"
]
}
];
$scope.test = ""; //$scope.acctountDetails.length;
for(var i=0; i<$scope.acctountDetails.length; i++) {
if(accounts.id == $scope.acctountDetails[i].id) {
$scope.test = $scope.acctountDetails[i].description;
}
}
}
}