You cannot pass a variable by reference in Javascript. However, you can pass the complete object and change your values.
In your case, you can pass the $ scope object and then change the value of the property. Something like that:
$scope.modifyVar = function (myObj){ myObj.txtNumberOfChuck = 92; } $scope.modifyVar($scope);
source share