title: calling ng-show on specific element based on parameter (angular)
body: <p>In my menu I have a lot of buttons that open submenus.
  <br>Since I don't want a massive switch in my code that checks which button is pressed and which menu to animate I wanted to try the following:<br><br>
  In the <strong>HTML</strong> I call the function toggleVis with as a parameter the name of the element to be toggled:<br></p>
  
  <pre><code>&lt;ul class="sidebar-bottom-list" ng-controller="MenuController"&gt;
  &lt;li&gt;
      &lt;a href="#/dossier" ng-click="toggleVis(showSubmenuDos); go('/dossier')" ng-class="class" class="sidemenuItem"&gt;&lt;span class="glyphicon glyphicon-folder-open"&gt;&amp;nbsp;&lt;/span&gt;Dossiers&lt;/a&gt;
      &lt;div class="list-group narrow-list-group no-padding-bottom slider-top-bottom" ng-show="showSubmenuDos" ng-class="active"&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(0)"&gt;lijst&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(1)"&gt;algemeen&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(2)"&gt;partijen&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(3)"&gt;documenten&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(4)"&gt;notas&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(5)"&gt;royementen&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(6)"&gt;urenregistratie&lt;/a&gt;
          &lt;a href="#" class="list-group-item" ng-class="dosMenuItems(7)"&gt;voortgang&lt;/a&gt;
      &lt;/div&gt;
  &lt;/li&gt;
  &lt;!-- imagine more menu items like this one --&gt;
  </code></pre>
  
  <p>Then in my <strong>main.js</strong> I have the toggleVis function like this:<br></p>
  
  <pre><code>app.controller('MenuController', function($scope, $location) {
  
  //can be triggered by ng-click="go('/path')"
  $scope.go = function(path) {
      $location.path(path);
  };
  
  //toggle visibillity
  $scope.toggleVis = function(param) {
      //$scope.{param} = !$scope.{param}
      alert(param)
      $scope.param = !$scope.param;
      //param.ngShow = !param.ngShow;
      //$scope.this = !$scope.this;
  }
  });
  </code></pre>
  
  <p>As you can see I have tried some things, but nothing works.<br>
  Is there a way to do what I want, or is there a way to do this even better?<br>
  I am looking for a well explained answer.</p>