I have a json response controlOwners from backend now i want to set response to $scope.selectedOwners = [] , but its giving me undefined in console any idea what is going wrong here ?
ctrl.js
$scope.selectedOwners = [];
if ($state.is('app.editControl')) {
$scope.selectedOwners = angular.copy($scope.controlowners);
console.log('EDIT CONTROL OWNERS DATA', $scope.selectedOwners);
}
json.js
"controlOwners": [{
"workerKey": -1093,
"sourceFeed": null,
"statusLookUpCode": null,
"externalId": null,
"createdUserText": null,
"createdTimestamp": null,
"modifiedUserText": null,
"modifiedTimestamp": null,
"stdId": "ZK84T1N",
"ccId": null,
"empClasId": null,
"deptId": null,
"fullName": "Rajasekaran, Shanmuga",
}],
$scope.controlOwnersis json response