vendredi 15 janvier 2021

Trigger click event in Angular after filter using dispatch

I am trying trying to configure this function to expand mat-expansion-panels after the filter/search event is completed to expand the panels that contain active items, but I cannot seem to figure out how to write it. I am very new to Angular so I am not sure of the syntax.

Here is the function in my TS file:

  onExpandFilter(event: Event, area: StorageArea) {
    if (area.worksheetItems) {
      return this.getSortedWorksheetItems(area).filter;
      this.store.dispatch(new SetStorageAreaExpandStatus({
        status: true,
        areaId: area.id
      }));
    } else if (area === null) {
      this.unAssignedStorageArea$
        .pipe(first()).subscribe(unassigned => {
          this.store.dispatch(new SetStorageAreaExpandStatus({
            status: !unassigned.expandStatus,
            areaId: unassigned.id
        }));
        });

    }
      }

The button in the HTML is properly configured to trigger the onExpandFilter function, it is just not doing what I would like. Any suggestions?

Aucun commentaire:

Enregistrer un commentaire