Part of my HTML
<div>House Details:
<input type ="number" ng-model="house.totalArea" placeholder="total_area">
<input type="number" ng-model="house.cost" placeholder="Cost">
</div>
<div>Address:
<input type="text" ng-model="house.address.state" placeholder="state">
<input type="text" ng-model="house.address.city" placeholder="city ">
</div>
Angular:$scope.house = {};
$scope.house.address = {};
$scope.processRentForm = function () {
console.log($scope.house);
$http.post("http://localhost:8080/Property101/house/addHouse", $scope).
error(function (data, status, headers, config) {alert("Submit failed!!");
Code works fine for just $scope.house but
I'm getting a 400 eror ( syntactically incorrect) for nested JSON which is forming as
Object {address: Object, totalArea: 1000}
I have a Address class inside a House class on server side which have the similar no./names of parameters as the JSON I'm trying to send.
Some of the examples at SO have "house.address.state" syntax. I'm new angular, any help would be appreciated.