I have an array of objects which is created on a button click. Now I have a scope variable that is assigned a default value.
This scope variable is part of textbox so now when user updates the textbox value that value is not getting automatically updated in all the records in bonus property of $scope.job.referralsrecords.
Code:
$scope.job.defaultBonus = 65;
function addNewReferrals{
$scope.job.referrals.push({
id: null,
bonus: $scope.job.defaultBonus
});
}
Can anyone tell me why is this happening and how do I update all bonus property in $scope.job.referrals when the $scope.job.defaultBonus gets change?