title: which technique can I use to load an object's value in a form field and then update that value making it available to my $scope variable
body: <p>I am building an app that you can create, update and delete notes. I am wondering which technique I could use to load the value I want in the form field and still make it available to my <code>$scope</code> variable in the controller. It seems like I can't have both things going on (either start the form empty and then use <code>ng-model="title"</code> i.e. or I could load the value using <code>value="{{note.title}}"</code>, but then I can't make the value from the field available in the controller to then update my note. </p>
  
  <p>I believe it's very simple solution but I just could not find the answer in other sources. </p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code> &lt;script type="text/ng-template" controller="notesCtrl" id="/notes.html"&gt;
    &lt;div class="container"&gt;
      &lt;div class="row"&gt;
        &lt;div class="col-lg-9" style="position: relative"&gt;
          &lt;form ng-submit="updateNote()" &gt;
            &lt;div class="row"&gt;.&lt;/div&gt;
            &lt;div class="row"&gt;
              &lt;input type="text"   class="form-control" value="{{note.title}}" &gt;
              &lt;div class="row"&gt;.&lt;/div&gt;
              &lt;input type="text" class ="form-control" value="{{note.body}}"    style="width: 100%; height: 300px"&gt;
              &lt;div class="row"&gt;.&lt;/div&gt;
            &lt;/div&gt;
            &lt;button type="submit"&gt;Save Note&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>and my controller in <strong>app.js</strong></p>
  
  <pre><code>   .controller('notesCtrl', [
      '$scope', 
      'notesFactory', 
      'note', 
      '$stateParams', function(
          $scope, 
          notesFactory, 
          note, 
          $stateParams) {
          $scope.note = note;
  
          $scope.updateNote = function() {
          notesFactory.update(
              $stateParams.id,
              {
                  title: $scope.title,
                  body: $scope.body
              })
          }
   }])
  </code></pre>