Open marcialwushu opened 6 years ago
constructor(public navCtrl: NavController, private contact: ContactListService) {
this.contactList$ = this.contact .getContactList()
productList should be Product[] not Observable
onSelect(typeid) {
this.productService.getProducts()
.filter((item)=>item.ptypeid == typeid)
.subscribe((products) => {
this.productList = products;
});
}
Typescript Error
Type 'Observable<any[]>' is not assignable to type 'Observable'. Types of property 'subscribe' are incompatible. Type '{ (observer?: PartialObserver<any[]>): Subscription; (next?: (value: any[]) => void, error?: (err...' is not assignable to type 'Subscribe'. Types of parameters 'observer' and 'next' are incompatible. Type 'NextFn' is not assignable to type 'PartialObserver<any[]>'. Type 'NextFn' is not assignable to type 'CompletionObserver<any[]>'. Property 'complete' is missing in type 'NextFn'.