title: Getting form state from child to parent controller
body: <p>I'm fairly new to Angular and I'm facing difficulties in communicating between parent and child controllers.</p>
  
  <p>The jsfiddle is here - <a href="http://jsfiddle.net/NEuJ6/35/" rel="nofollow">http://jsfiddle.net/NEuJ6/35/</a></p>
  
  <p>What I'm doing is loading a form template based on a route with a new controller. The parent controller however has the "Save and Continue" button and I'm not able to understand on how to bind the changes in the form of the child (valid / invalid state) to the button disabled status of the parent.</p>
  
  <p><strong>In short, the problem is getting the live state of the form that lives in the child controller in the parent controller</strong></p>
  
  <p>I believe, this can be solved via a $watch, but I'm not sure how to proceed.</p>
  
  <p>Controller</p>
  
  <pre><code>&lt;div ng-controller="MainCtrl"&gt;
    &lt;ul&gt;
      &lt;li&gt;&lt;a href="#/new"&gt;New User&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#/edit"&gt;Edit USer&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;To continue as guest, click on submit&lt;/li&gt;
    &lt;/ul&gt;
    &lt;ng-view&gt;&lt;/ng-view&gt;
      &lt;button ng-click="save()"&gt;Save and continue&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Routes</p>
  
  <pre><code>app.config( function ( $routeProvider ) {
    $routeProvider
    .when('/edit', {
        templateUrl: "form.html", 
        controller: "EditController"
    })
    .when('/new', {
        templateUrl: "form.html",
        controller: "NewController"
    })
  });
  </code></pre>
  
  <p>The second question is around loading the next step of the process. When the user clicks submit and the form is valid, in that case, I would like to change the ng-view with a new template. Is something like below recommended (in the controller)?</p>
  
  <pre><code>if (form.$valid) {
     location.path('/next')
  }
  </code></pre>
  
  <p>or should I make the continue button an <code>a</code> tag and do something like </p>
  
  <pre><code>&lt;a href="#/next" ng-click="validate()"&gt;Save and continue&lt;/a&gt;
  </code></pre>
  
  <p>In both the cases, I will have a new route added.</p>
  
  <pre><code> .when('/next', {
            templateUrl: "next.html", 
            controller: "NextController"
    })
  </code></pre>