Hello, I used the RouterLink which passes an id to the url, I look for this id and I step as a parameter to the function that searches the api data, but when I click on my link it redirects to the route I want, but not shows my data I'm iterating, and the api return array gets undefined. But if I reload the route again then yes it shows the data:
This is my link
<a routerLink="/wines/{{uvas.id_uva}}">{{uvas.uva}}</a></li>
My component
ngOnInit() {
this.Wine = this.route.paramMap.pipe(
switchMap((params: ParamMap) =>
this._dataService.getWine(params.get('id'))
);
}
My Service
getWine(id): Observable<IWine> {
return this.http.get<IWine>('http://localhost:8888/exemplo/${id}');
}