title: With angularjs, how can I trigger a click, or is there a better way?
body: <p>I'm creating a form wizard with AngularJS.</p>
  
  <p>Think of each <strong>fieldset</strong> like so:</p>
  
  <pre><code>&lt;div ng-controller="MyController as fs"&gt;
    &lt;fieldset&gt;
        ...
        &lt;button ng-click="fs.StepForward($event)"&gt;Next&lt;/button&gt;
    &lt;/fieldset&gt;
  
    &lt;fieldset&gt;
        ...
        &lt;button ng-click="fs.StepBackward($event)"&gt;Previous&lt;/button&gt;
        &lt;button ng-click="fs.StepForward($event)"&gt;Next&lt;/button&gt;
    &lt;/fieldset&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>What I've done is, in my controller found the current fieldset and the next fieldset like so:</p>
  
  <pre><code>app.controller("MyController", function() {
    var ft = this;
    ft.StepForward = function(event) {
      // It's here that I need to find the fieldset
      ft.current_fs = event.currentTarget.parentNode;
      ft.next_fs = event.currentTarget.parentNode.nextElementSibling;
    }
  });
  </code></pre>
  
  <p>So first, I'm not sure if this is the absolute best way to do it, but it works. </p>
  
  <p>Down to my main question... Inside of one of the fieldsets I have some li elements, and if certain elements are clicked, I want to trigger a click on the NEXT button automatically. </p>
  
  <p>I tried adding an <strong>ng-click</strong>:</p>
  
  <pre><code>&lt;fieldset&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a ng-click="fs.TriggerClick($event)"&gt;Some Itme&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;button id="MyButtonTest" ng-click="fs.StepForward($event)"&gt;Next&lt;/button&gt;
  &lt;/fieldset&gt;
  
  app.controller("MyController", function() {
    var ft = this;
    ft.StepForward = function(event) {
      // It's here that I need to find the fieldset
      ft.current_fs = event.currentTarget.parentNode;
      ft.next_fs = event.currentTarget.parentNode.nextElementSibling;
    }
  
    ft.TriggerClick = function(event) {
      angular.element('#MyButtonTest').trigger('click');
    }
  });
  </code></pre>
  
  <p>But when I created a function to trigger a click on the button, I got the error:</p>
  
  <pre><code>Error: $rootScope:inprog Action Already In Progress
  </code></pre>
  
  <p>So I'm wanting to reach to jQuery, but I'm sure there's an angular way of doing this. </p>