title: How to click on a link with angularjs?
body: <p>I'm trying to trigger a click on a link, but it only runs the ng-click
  From MyScript.js:</p>
  
  <pre><code>$timeout(function () {
              angular.element(document.querySelector('#cancelButton')).triggerHandler('click');
          }, 0);
  </code></pre>
  
  <p>And from Index.cshtml:</p>
  
  <pre><code>&lt;a href="#" ng-click="abortCart()" id="cancelButton"&gt;&lt;input class="popupButton" type="button" value="Anuluj" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>I know that the way I did with </p>
  
  <pre><code>&lt;a...&gt;&lt;input... /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>is wrong,
  but the important thing is: how to it to click the link and the ng-click?</p>