0

I'm using Angular Calendar to display some events, data is stored in Firestore.

this is my code :

events$!: Observable<CalendarEvent<{ drop: Drop }>[]>;

let drops$ = from(this.drops);
    this.events$! = drops$.pipe(({ result }: { results: Drop[] }) => {
      return result.map((drop: Drop) => {
        return {
          title: drop.campaignName,
          start: new Date(drop.dropDate),
        };
      });
    });

I got a error :

Argument of type '({ result }: { results: Drop[];}) => any' is not assignable to parameter of type 'OperatorFunction<Drop, CalendarEvent<{ drop: Drop; }>[]>'. Types of parameters '__0' and 'source' are incompatible. Property 'results' is missing in type 'Observable' but required in type '{ results: Drop[]; }'.ts(2345)

is there any solution to populate the events$ observable ?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Wahéb
  • 541
  • 1
  • 5
  • 15

0 Answers0