Argument of type ‘number’ is not assignable to parameter of type Custom Request

  angular

I am getting the following error but am not sure why.

Argument of type 'number' is not assignable to parameter of type 'CustomRequest'

this.accountNumber = 4048358124;
//When I pass account number as a parameter below I get the error
this.myService.myMethod(this.accountNumber).subscribe((resp)=>{
      console.log("CustomRequest response: "+resp);
})

export interface CustomRequest{
  accountNumber: number
}

myMethod(request: CustomRequest): 
  Observable<CustomResponse> {
  return this.myProxyService.GetAVAFPreValidateLoanAdjustment(request);
}

I don’t know why it is saying that type number is not the same type as CustomRequest as they are both numbers. Any ideas?

Source: Angular Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.