i get null in the subscribe statemaent, the Api returns the correct data, but in angular its accepted as null. what should be the problem? here is my subscribe in ts:
this.service.getFlightId( this.addFlightForm.controls["date"].value, this.addFlightForm.controls["time"].value,
this.originId,
this.destinationId,
this.addFlightForm.controls["flightNum"].value)
.subscribe(data=>{
this.flight=data;
}, err=>{
this.noFlightId=true;
});
and this is my serviece:
getFlightId(date:Date,time:Time,originId:number,destinationId:number,flightNum:number):Observable<Flight>{
return this._http.get<Flight>("/api/flight/"+date+"/"+time+"/"+originId+"/"+destinationId+"/"+flightNum);
}