I have a scope variable which has false value by default.
I want when I pass this variable to a function to modify it's value to true.
but this can't be done since the passage of params in JavaScript is by value.
this is a simple code of what I'm tryin to do:
myapp.controller('PersonCtrl', function ($scope) {
$scope.step = false;
change($scope.step);
console.log($scope.step);
});
change = function(step){
step = true;
}
jsfiddle:
http://jsfiddle.net/SNF9x/177/
how can I solve this ?