veliyat / angular-8-shopping-cart

This is the code which relates to the Angular 8 Shopping Cart Creation Tutorial on YouTube
https://youtu.be/k1kb-Aqy1t4
53 stars 51 forks source link

I am getting error called no overload matches this call #8

Open kishore0995 opened 3 years ago

kishore0995 commented 3 years ago

At this line in cart.component.ts ( this.msg.getMsg().subscribe((product:Product) =>) i am getting error how to solve this

No overload matches this call. Overload 1 of 5, '(observer?: NextObserver | ErrorObserver | CompletionObserver | undefined): Subscription', gave the following error. Argument of type '(product: Product) => void' is not assignable to parameter of type 'NextObserver | ErrorObserver | CompletionObserver | undefined'. Property 'complete' is missing in type '(product: Product) => void' but required in type 'CompletionObserver'. Overload 2 of 5, '(next?: ((value: unknown) => void) | undefined, error?: ((error: any) => void) | undefined, complete?: (() => void) | undefined): Subscription', gave the following error. Argument of type '(product: Product) => void' is not assignable to parameter of type '(value: unknown) => void'. Types of parameters 'product' and 'value' are incompatible. Type 'unknown' is not assignable to type 'Product'.ts(2769)

veliyat commented 3 years ago

I think this is related to some coding error, kindly compare my code of the specific video with yours. You can get code related to all the parts from this google drive link.