title: Unable navigate to new tab on click of mouse middle button/ ctrl+ click in angular js
body: <p>Currently i am using angular 1.6 application
   I implemented this code from stackoverflow but this is not solving my solution.</p>
  
  <p>this is my code below</p>
  
  <pre><code>app.run(function($rootScope, $state) {
  
  $rootScope.navigate = function($event, to, params) {
  
      // If the command key is down, open the URL in a new tab
      if ($event.metaKey) {
          var url = $state.href(to, params, {absolute: true});
          window.open(url,'_blank');
  
      } else {
          $state.go(to, params);
      }
  
  };
  
  });
  </code></pre>
  
  <p>My HTML code</p>
  
  <pre><code>&lt;div class="title" data-ng-click="$ctrl.goToDetails($event)" data-ng-bind="$ctrl.config.entryTitle"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>$state.go('entry-details', { entryId: vm.config.id, query: vm.query });
  </code></pre>
  
  <p>I am new to angular so please suggest how to implement.
  it would be better if i get a fiddle.</p>