title: Passing scope variable to function in ng-click
body: <p>So I know I must be missing some basic part of javascript with this quesiton but here it goes anyhow:</p>
  
  <p>I have a contoller that has a variable declared in it:</p>
  
  <pre><code>$scope.IsStartDatePickerHidden = true;
  $scope.IsEndDatePickerHidden = true;
  </code></pre>
  
  <p>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:</p>
  
  <pre><code>&lt;button type="button" ng-click="showDatePicker(IsStartDatePickerHidden)" &gt;
  
   $scope.showDatePicker = function(showDatePicker)
   {
       showDatePicker = false;
   }
  </code></pre>
  
  <p>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.</p>