When do we need to bind an method to $scope in controller,i am dealing with methods which is just mapping operation on object.
Example :
$scope.myVar = {};
function myMyObject(x) {
$scope.myVar = {
"xKey":x
}
}
to
$scope.myMyObject = function(x) {
$scope.myVar = {
"xKey":x
}
}
myMyObject(10);
$scope.myMyObject(10);
Is it necessary to bind $scope to myMyObject method here ?