I have a subscription to get parameters come with the route and in that subscription(after it success) I am calling another subscription from the same service to get message details. the problem is: when the parameter changed the subscription that related with old parameter still alive.
this.routes.params.subscribe(param => {
this.isLoading = true;
this.messageId = param['id'];
this.inboxService.getMessageDetail(toNumber(this.messageId)).subscribe((dat) => {
this.initMessageDetails(dat);
})
})