Hi I am getting an error when i tries to do the following operation
export class FlightFormTemplatesStepComponent
{
tagonMessagePrefix: TagOnMessagePrefix;
ngOnInit() {
this.flightService.get(this.flightId).pipe(
tap (flight => {this.flight = flight}),
mergeMap( (flight) => {
return this.flightService.getTagonMessagePrefix(flight);
})
).subscribe(
(tagonMessagePrefix) => { this.tagonMessagePrefix = tagonMessagePrefix}
);
}
}
this is the error I am recieving.
property) FlightFormTemplatesStepComponent.tagonMessagePrefix: TagOnMessagePrefix
Type '{}' is missing the following properties from type 'TagOnMessagePrefix': id, flightName, flightTagonTypes, configuredGlobalTagonSettings, tagonTextts(2739)
Any idea how can i fix this issue
I changed to map operation and it works
this.flightService.get(this.flightId).pipe(
tap (flight => {this.flight = flight}),
switchMap( (flight) => {
return this.flightService.getTagonMessagePrefix(flight);
})
).subscribe(
(tagonMessagePrefix:TagonMessagePrefix) => { this.tagonMessagePrefix = tagonMessagePrefix}
);