Fiddle: http://jsfiddle.net/RnJbt/2/
I have a template block, where I initiate a local model, which is not really important to be included in the namespace, but is useful for the template's scope. The model is passed to a function when user clicks on a button. The function should update the value of the model.
Fiddle shows that the model "deneme" does not change when passed as an argument to update function. But I can update the value in the "update" function if I access the model via the $scope
object as given below.
...controller...
$scope.update = function(val){
val = 10; // does not update deneme
$scope.deneme = 34; // updates it as expected
}
I don't want to pollute the controller's namespace with throwaway model names that are only useful for the template blocks they are initiated. How can i process almost anonymous arguments within controller scope without having to declare them by their names?