Take a look at my simple plunker
Within the code, I am attempting to link a scope variable to an object property.
$scope.name = 'World';
var obj = {
"name":$scope.name
}
$scope.$watch('name', function(){
console.log(obj["name"]);
})
Even after changing the name, the console.log consistently displays "World." How do I go about updating the obj with this change?
This query specifically pertains to extracting values from alternative sources (such as function parameters) due to the necessity of modifying obj for use in other sections of code.