I am relatively new to WebAPI/AngularJS and am having a problem passing an object using $http.get() to a WebAPI controller from an AngularJS controller.
AngularJS Controller Code:
$http.get('api/Employee/GetVacancyStatus?emp='+thisData[0])
.then(function (response, success) {
if (response.data == false){
alert("cube/office occupied");
}
else // continue with employee move
{
do some stuff...
}
}, function (response, error) {
alert(response);
});
Web Api Controller Code:
[System.Web.Http.HttpGet, System.Web.Http.ActionName("GetVacancyStatus")]
public bool GetVacancyStatus([FromUri] employee emp)
{
//return repository.GetVacStatus(moveQuery);
return false;
}
When I debug the code, the object appears to be populated in the AngularJS Controller (at least from looking at my Chrome developer tools):
On the other hand, when execution hits the WebAPI controller, it seems that the object is uninitialized and I can't determine what I am doing wrong.
I do have an $http.put() that seems to be working passing an object like this:
$http.put('api/Employee/PutEmployee', emp)
Thanks in advance for any assistance.

