title: Controller constructor function executing multiple times in Angular
body: <p>So my problem is that <code>Controller</code> constructor executes multiple times. If I have 2 <code>Directives</code> associated with particular <code>Controller</code> then it runs <code>2 + 1</code>, if 3 <code>Directives</code>, then <code>3 + 1</code>... and so on. If I have an ajax request in that controller to get data, then it runs that much times which isn't really necesarry...</p>
  
  <p>Why is it so? I'm very concerned that it makes all those extra unnecessary ajax requests...</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code> &lt;span ng-controller="MenuController as MenuCtrl"&gt;
      &lt;main-menu&gt;&lt;/main-menu&gt;
   &lt;/span&gt;
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>  var howManyTimes = 0;
    angular.module("shredkit", ["myDirectives"])
  
    .controller("MenuController", function(){
      ++howManyTimes;
      console.log("HOW MANY TIMES? THAT MANY: " + howManyTimes )
    })
  </code></pre>
  
  <p><strong>Directive:</strong></p>
  
  <pre><code>angular.module("myDirectives", [])
  
    .directive("mainMenu", function(){
      return{
        restrict:"E", // type of directive - 'E' - element
        templateUrl:'templates/main-menu.html',
        controller:"MenuController",
        controllerAs: "MenuCtrl"
      };
    })
  </code></pre>