title: Replacing ng-href with ng-click
body: <p>I am developing a mobile application and found that angularjs 1.1.4 has a <strong>ngTap</strong> directive available replacing standard <strong>ng-click</strong>. It makes app more robust, so I've decided to replace all my ng-href directive with ng-tap. For this purpose I've created a <strong>"go()</strong>" function available from $rootScope. The problem is that it can not resolve the url variable.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>$rootScope.go = function (url) {
      $location.path(url);
  }
  </code></pre>
  
  <p>and in template:</p>
  
  <pre><code>&lt;a class="niceButtonLikeStyled" data-ng-click="go(/somewhere/var.id/)"&gt;{{ var.id }}&lt;/a&gt;
  </code></pre>
  
  <p>Using data-ng-click as ngTap is portable and replaces ng-click if new ngMobile loaded.
  My problem seems to be with go() argument (mixing static &amp; variable content ?</p>
  
  <p>Maybe there's the other way of just binding new ng-click to all links.. or simply adding own directive that would take value from ng-href and made the location redirect and attach the ng-tap click event.</p>