title: add controller to a template menu in ionic1
body: <p>I have an application made in ionic1 and my application contains a template called <code>menu.html</code> and it contains a<code>&lt;ion-side-menus&gt;</code>which is loaded with my other templates and views. the issue is that I want my variables in the $scope can be seen directly in my template <code>menu.html</code> depending on the driver that is currently loaded.</p>
  
  <p>for example in my controller actual I have: </p>
  
  <pre><code>$scope.title="hello";
  </code></pre>
  
  <p>in <code>menu.html</code>:</p>
  
  <pre><code>{{title}} (should be display "hello")
  </code></pre>
  
  <p>but my <code>$scope</code> variables are not shown in <code>menu.html</code>
  if I add <code>ng-controller = "myControllerController"</code> it works, but I want to avoid this solution, since the contents of my controller will be loaded twice. and I've done the test putting a console.log ("it loads") and this message appears two times. I need that the $scope of menu to be according to the current controller.</p>
  
  <p>this is my code:</p>
  
  <p><strong>menu.html:</strong></p>
  
  <pre><code>&lt;ion-side-menus enable-menu-with-back-views="false"&gt;
    &lt;ion-side-menu-content&gt;
      &lt;ion-nav-bar class="bar-stable"&gt;
        &lt;ion-nav-back-button&gt;
        &lt;/ion-nav-back-button&gt;
  
        &lt;ion-nav-buttons side="left"&gt;
          &lt;button class="button button-icon button-clear ion-navicon"  menu-toggle="left" &gt;
          &lt;/button&gt;
        &lt;/ion-nav-buttons&gt;
      &lt;/ion-nav-bar&gt;
      &lt;ion-nav-view name="menuContent"&gt;&lt;/ion-nav-view&gt;
    &lt;/ion-side-menu-content&gt;
  
    &lt;ion-side-menu id="sidemenu"  side="left"  &gt;
      &lt;ion-header-bar class="bar-stable"&gt;
        &lt;h1 class="title"&gt;{{title}}&lt;/h1&gt;  &lt;!-- title --&gt;
      &lt;/ion-header-bar&gt;
      &lt;ion-content&gt;
        &lt;ion-list&gt;
          &lt;ion-item menu-close href="#/app/productos"&gt;
            Registro
          &lt;/ion-item&gt;
          &lt;ion-item menu-close href="#/app/buscar"&gt;
            Buscar
          &lt;/ion-item&gt;
          &lt;ion-item menu-close href="#/app/ubicaciones"&gt;
            Ubicación
          &lt;/ion-item&gt;
        &lt;/ion-list&gt;
      &lt;/ion-content&gt;
    &lt;/ion-side-menu&gt;
  &lt;/ion-side-menus&gt;
  </code></pre>
  
  <p><strong>controller actual: myControllerController.js</strong></p>
  
  <pre><code>tinApp.controller('myControllerController', function($scope) {
   $scope.title="hello";
  });
  </code></pre>
  
  <p><strong>App.js:</strong></p>
  
  <pre><code>.state('app', {
   url: '/app',
   abstract: true,
   templateUrl: 'templates/menu.html'
  })
  
  .state('app.view1', {
  url: '/view1',
  views: {
    'menuContent': {
      templateUrl: 'templates/view1.html',
      controller: 'myControllerController'
    }
  }
  })
  </code></pre>