So I know I must be missing some basic part of javascript with this quesiton but here it goes anyhow:
I have a contoller that has a variable declared in it:
$scope.IsStartDatePickerHidden = true;
$scope.IsEndDatePickerHidden = true;
I have a button that has its ng-click set to go to a function in my controller. This function would be nice if it took in a parameter which it can change the value:
<button type="button" ng-click="showDatePicker(IsStartDatePickerHidden)" >
$scope.showDatePicker = function(showDatePicker)
{
showDatePicker = false;
}
when I step through this code the function showDatePicker changes the value of the parameter that is passed in but does not seem to change the value of the variable in the controller, so nothing happens. I am sure this has to be something to do with passing by reference. I am just not sure how to pass this in so that $scope.IsStartDatePickerHidden or $scope.IsEndDatePickerHidden are changed depending on which one I pass in.