HTML Code:
<div ng-repeat="addr in addrShipData">
<input type="radio" name="resp1" ng-checked='true'/>
{{addr.addressLine1 +","+addr.addressLine2+", "+addr.city+ ","+addr.state+", "+addr.country+", "+addr.zipCode+","+addr.contactNum}}
<a>Edit</a>
</div>
JavaScript Code:
var dataObj = [];
var shipDataObj = [];
//var addrShipData =[];
function shipData(shipDataObj){
for(i=0;i<shipDataObj.length;i++){
dataObj.push(addressLine1 = shipDataObj[i].addressLine1);
dataObj.push(addressLine2 = shipDataObj[i].addressLine2);
dataObj.push(city = shipDataObj[i].city);
dataObj.push(state = shipDataObj[i].state);
dataObj.push(country = shipDataObj[i].country);
dataObj.push(zip = shipDataObj[i].zipCode);
dataObj.push(contactNum = shipDataObj[i].contactNumber);
}
}
appServices.getAddress(userData.customerId).then(function (data){
if (data){
console.log(data);
$scope.shipDataObj = data;
shipData(data);
console.log("dataObj properties: " + dataObj);
$scope.addrShipData = dataObj;
console.log($scope.addrShipData);
if ($scope.addrShipData){
storeLocally.set('shipInfo :', $scope.addrShipData);
}
else{
$scope.addressError = "No Address Found!";
}
console.log("address info:- " + $scope.addrShipData);
}
}),
function (data) {
if (data.status == 500) {
$scope.addressError = "Oops! No Address Found!";
};
}
I have encountered an issue where the values in $scope.addrShipdata are displaying on the console, but not appearing in the HTML view.
The output is as follows:
On Console: 1234 Waller Ave, Suite 1, Fremont, California, USA, 246326, 213-435-4365
On HTML View: it shows blank. O ,, , , , , Edit O ,, , , , , Edit O ,, , , , , Edit O ,, , , , , Edit O ,, , , , , Edit O ,, , , , , Edit O ,, , , , , Edit
No errors are being displayed, and I am unable to determine the cause of this issue within the code.