title: Angular - how to concat var name
body: <p>I just started to learn Angular, and I tried to make concat var name so I can control it dynamically.</p>
  
  <p>This is what I tried - </p>
  
  <pre><code>&lt;div ng-app="myApp" ng-controller="myCtrl"&gt;
  
  &lt;button ng-click="myFunc(1)"&gt;Click Me!&lt;/button&gt;
  
  &lt;div ng-show="showMe1"&gt;
      &lt;h1&gt;Menu:&lt;/h1&gt;
      &lt;div&gt;Pizza&lt;/div&gt;
      &lt;div&gt;Pasta&lt;/div&gt;
      &lt;div&gt;Pesce&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;script&gt;
  var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope) {
      $scope.showMe1 = false;
      $scope.myFunc = function(x) {
          var nametocng = 'showMe'+x;
          //var nametocng = $parse("showMe"+x);  // - I tried this also
          $scope.nametocng = !$scope.nametocng;
      }
  });
  &lt;/script&gt;
  </code></pre>