title: Using $localStorage inside the controller
body: <p>Description:</p>
  
  <p>I have a user information screen where we get user details and store it in the DB when <code>save</code> is selected (this is activated only once). Im using <code>$localStorage</code> in my controller in-order to hold the data entered by the user,so that when app is closed and opened the same information exists. And also when the information are edited the changes should be seen in the settings and also get stored in both the DB and also in <code>$localStorage</code>.</p>
  
  <p>Problem:</p>
  
  <p>when I try to save the data Im getting error <code>Error: [$injector:unpr] Unknown provider: $localStorageProvider &lt;- $localStorage &lt;- revenue-management-controller</code>. This the first time Im try using the <code>$localStorage</code>, Im not sure if Im using it right. Im trying to use two <code>$localStorage</code>, one to store the data during <code>save</code> action. Another one during <code>update</code> action. So please help in this.</p>
  
  <p>Html:</p>
  
  <pre><code>Name:
  &lt;input type="text ng-model="name"&gt;
  DOB:
  &lt;input type="date" ng-model="dob"&gt;
  Area of Interest:
  &lt;input type="text" ng-model="interest"&gt;
  
  &lt;button type="submit" ng-click="Add()"&gt;Add&lt;/button&gt;
  &lt;button type="submit" ng-click="update()"&gt;Update&lt;/button&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>myApp.controller('userInfo', function ($scope, $state, $localStorage, userDataManagement) {
  
          $scope.Add = function () {
              var userData = {'name': $scope.name, 'dob': $scope.dob, 'interest': $sope.interest};
              $localStorage.savedInfo = userData;
              userDataManagement.postData(userData, error);
          };
          $scope.update = function () {
              var userData2 = {'name': $scope.name, 'dob': $scope.dob, 'interest': $scope.interest};
              $localStorage.updateInfo = userData2;
              userDataManagement.postData(userData2, error)
          };
      }
  )
  </code></pre>