title: Create error in angularJs
body: <p>This is my angular controller:</p>
  
  <pre><code>app.controller("custctrl",["$scope","Restangular",function($scope,Restangular){
  $scope.createcust=function(){
  Restangular.all("customer").post($scope.cust);
  console.log($scope.cust);
  };
  }]);
  </code></pre>
  
  <p>In the console I can find the object but the insertion failed and I get this error:</p>
  
  <p>angular.js:10765 POST <a href="http://localhost:9000/customer" rel="nofollow">http://localhost:9000/customer</a> 400 (Bad Request)</p>
  
  <p>I'm using a modal and this is a part of my code:</p>
  
  <pre><code>&lt;div  id="inputModalCust" class="modal fade" ng-controller="custctrl" &gt;
              &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
  
                              &lt;h4 class="modal-title"&gt;&lt;Strong&gt;&lt;i class="fa fa-file"&gt;&lt;/i&gt; Customer &lt;/Strong&gt;&lt;/h4&gt;
                      &lt;/div&gt;
                      &lt;div class="modal-body"&gt;
                            &lt;form  class="form-horizontal" &gt;
                               &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Name&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.identity.companyName" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                                  &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;logo&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.logo" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                                    &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Email&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.linkset" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                               &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Phone&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.colorSet" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                                 &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Website&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.webSite" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                           &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Category&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.category" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                                &lt;div class="form-group"&gt;
                                  &lt;label for="input" class="col-md-2 control-label"&gt;Time zone&lt;/label&gt;
                                  &lt;div class="col-md-10"&gt;
                                      &lt;input type="text" ng-model="cust.timeZone" class="form-control" placeholder="Value"&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;                        
  
                          &lt;/form&gt;
                          &lt;/div&gt;
                           &lt;div class="modal-footer"&gt;
                              &lt;button type="button" data-dismiss="modal" class="btn btn-default" &gt;&lt;i class="gi gi-remove_2"&gt;&lt;/i&gt; &lt;Strong&gt;Close&lt;/Strong&gt;&lt;/button&gt;
                              &lt;button type="button"  data-dismiss="modal" class="btn btn-primary" ng-click="createcust()"&gt;&lt;i class="gi gi-floppy_saved" &gt;&lt;/i&gt;&lt;Strong&gt; Save&lt;/Strong&gt;&lt;/button&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>