In the following function I am trying to call the ProductServices's getSelectProduct method. private getSelectedProduct = () => { const productId = this.activatedRoute.snapshot.paramMap.get('productId'); console.log('selectedProduct', productId) this.productService.getSelectedProduct(productId).subscribe(product => { this.selectedProduct = product; }) } Typescript is giving me a red squiggly under the productId in this statement: getSelectedProduct(productId). The error message is: Argument of type 'string | null' is not assignable to parameter of type 'string'. Type 'null' is not assignable to type 'string'.ts(2345) const productId: string | null This is the declaration of selectedProduct: public selectedProduct?roductModel; This is the getSelectedProduct method: public getSelectedProduct = (productId:string) => { const product = this.productSignal().products.find(product => product._id === productId) return of(product) } Continue reading...