I have the following GET method in order to pass params to my API server(and get an instance of employee from database at the end), but when debugging, I have noticed that the parameter being passed is null
.
I'm assuming that I'm doing something wrong, but not sure what exactly.
The http error (of course) is : 500 (Internal Server Error) - System.NullReferenceException
.
That's my Angular code:
getEmp(id: number): Observable < any > {
let params: URLSearchParams = new URLSearchParams();
params.set('id', id.toString());
return this._http.get(AppSettings.getEmp, {
search: params
})
.map((data: any) => data.json());
}
That's the subscriber:
getEmpService() {
this._adminService.getOved(this.adminForm.value.id).subscribe((res) => {
debugger;
if (res) { ...
}
}, error => {
console.log("failed");
})
}
I can clearly see that the value is being sent on the client side is correct, but not sure what's happening from that moment
Angular Version : ^7.1.4