title: Why angular sets undefined to empty ng-model fields
body: <p>I have simple crud application in Angular (1.2) and Laravel (4.2). To simple crud operations I use efficient Eloquent method:</p>
  
  <pre><code>$product-&gt;fill(Input::all());
  </code></pre>
  
  <p>which takes all fields from request payload, but is there a problem when I need to do update model with empty fields.</p>
  
  <p>In the edit action I have a form which is filled with the response of $resource get method of my service:</p>
  
  <pre><code>adminModule.factory 'Product', ($resource) -&gt;
    $resource '/admin/products/:id', { id: '@id' }, {
      query: { method: 'GET', isArray: false }
      update: { method: 'PUT' }
    }
  </code></pre>
  
  <p>a controller:</p>
  
  <pre><code>adminModule.controller 'ProductFormEditController', ($scope, Product, $stateParams) -&gt;
  
    $scope.formData = Product.get({id: $stateParams.id})
  </code></pre>
  
  <p>and html:</p>
  
  <pre><code>    &lt;input  type="text" data-ng-model="formData.name" name="name" class="form-control" id="name"
                             placeholder="Nazwa" data-server-error required&gt;
  </code></pre>
  
  <p>If I clear this field value and do submit the value of $scope.formData is set to undefined and there is not included in the PUT request, so the Laravel model fill method doesn't see the field anyway and don't sets the empty value for the validation, but takes the original value of the model.</p>
  
  <p>The problem is: How can I send the empty string from ngModel instead of undefined?</p>
  
  <p>p.s. If the input type is Textarea the $resource send empty "" string :-/, so I'm confusing...</p>