I created a service returning user details from server using the HttpClient.get.
public getUser(id: number): Observable<User>{
return this.http
.get<User>('myUrl?id='+id);}
I have injected the service into a component.
In the component I would like to get a user so I have subscribed to the service method which is returning Observable<user>.
so far so good.
my problem:
Now I would like to get another user and the question is how do I activate the service method to get the user again?
Should I unsubscribe and subscribe again every time I need a user?