title: Angular.JS: views sharing same controller, model data resets when changing view
body: <p>I'm getting started with Angular.JS.</p>
  
  <p>I have a number of views that share the same controller. Each view is a step in collecting data that is stored in the controller:</p>
  
  <pre><code>$routeProvider.when('/', {
    templateUrl: 'partials/text.html',
    controller: 'itemSubmitter'
  });
  
  $routeProvider.when('/nextThing', {
    templateUrl: 'partials/nextthing.html',
    controller: 'itemSubmitter'
  });
  </code></pre>
  
  <p>The itemSubmitter controller:</p>
  
  <pre><code>$scope.newitem = {
    text: null
  }
  </code></pre>
  
  <p>Here's the first view:</p>
  
  <pre><code>&lt;textarea ng-model="newitem.text" placeholder="Enter some text"&gt;&lt;/textarea&gt;
  
  &lt;p&gt;Your text is:
  {{ newitem.text }}&lt;/p&gt;
  </code></pre>
  
  <p>This works, live updating the 'Your text is:' paragraph.</p>
  
  <p>However when the next view is loaded, <code>{{ newitem.text }}</code> is reset to its default value. How can I make values stored in a controller instance persist across views?</p>