title: AngularJS promises and ng-model
body: <p>Using this service to perform promises:</p>
  
  <p>using this service to perform promises: <a href="https://stackoverflow.com/questions/19420511/improving-angularjs-simple-factory-wrapper-around-phonegap-storage-api/19421504?noredirect=1#19421504">Improving AngularJS Simple Factory - wrapper around PhoneGap Storage API</a></p>
  
  <p>I can't figure out, why i am getting error when using ng-model directive and promises.</p>
  
  <pre><code>TypeError: Cannot assign to read only property 'favourite' 
  </code></pre>
  
  <p>when clicking</p>
  
  <pre><code>&lt;div ng-controller="DishCtrl"&gt;
      &lt;input type="checkbox" name="favourite" ng-model="dish.favourite" required smart-float ng-click="markFavourite(dish)"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and controller as follows:</p>
  
  <pre><code>angular.module('App')
    .controller('DishCtrl', function($scope, NotificationService, MediaService, SQLService, $routeParams, $rootScope) {
  
  
      var dishId = $routeParams.dishId;
      SQLService.getDish(dishId).then(function(results) {
        $scope.dish= results;
      });
  </code></pre>
  
  <p>if i remove ng-model directive everything works. So promise is resolved correctly i quess.
  I also tried to bind model directly - without promise and works.
  Is it a bug, or did i missed something?</p>
  
  <p>I am trying also resolving promises as example in here: <a href="http://jsfiddle.net/8HjgJ/" rel="nofollow noreferrer">http://jsfiddle.net/8HjgJ/</a></p>