title: Attempted to assign to readonly property
body: <p>I am getting exception with message <code>Attempted to assign to readonly property</code> when I try to assign a value to property defined in a service.</p>
  
  <p>My Cordova project uses AngularJS. Here is a part of my code:</p>
  
  <pre><code>'use strict';
  
  angular.module('MyApp.controllers')
  .service('LoginOrigin', function () {
          return {
              origin: undefined
          };
      });
  
  angular.module('MyApp.controllers')
      .controller('MainCtrl', ['$scope', '$http', '$rootScope', 'LoginOrigin',
          function($scope, $http, $rootScope, LoginOrigin) {
  
              $scope.signUp = function() {
                  // ...
                  // exception gets thrown on the following line
                  LoginOrigin.origin = 'menu';
                  // ...
              };
          }
      ]);
  </code></pre>
  
  <p>Why I am getting the exception and how could I chnage the code to fix the issue?</p>