I have a post method on the backend ( Spring boot ) that returns the id when I post data.
@RequestMapping(value="/fncs", method=RequestMethod.POST)
public int addFnc(@RequestBody Fnc fnc){
fncservice.addFnc(fnc);
return fnc.getN_fnc();
}
I want to create a function in angular service that return me the id (number) ,I tried it with this function but it didn't work.
const baseUrl = 'http://192.168.100.9:8081/fncs';
create(data): Observable<any> {
return this.http.post(baseUrl, data);
}
