Try to move your subscribe to ngOnInit()
ngOnInit(): void { this.subscriptions.push(this.myservice.currentProdId.subscribe((result: any) => { if (result) { this.productId = productId; } })); }));