Skip to content

Content projection with selectors in themed components is not working #4126

@AndreaBarbasso

Description

@AndreaBarbasso

Describe the bug

Angular's content projection with selectors (e.g. <ng-content select="[additionalSearchOptions]") in themed components is not working properly. Instead of projecting different elements in different content outlets, it projects all of them into the last (or default) ng-content found.

To Reproduce

Steps to reproduce the behavior:

  1. Use content projection in a themed component, for example you can use this template into the my-dspace-page component:
  <ds-search
    [configuration]="configuration"
    [configurationList]="(configurationList$ | async)"
    [context]="context"
    [viewModeList]="viewModeList">
      <p additionalSearchOptions>additionalSearchOptions</p>
      <p searchContentTop>searchContentTop</p>
  </ds-search>
  1. You will see that all the content will be projected in the same ng-content outlet, i.e. the last ng-content child of the ds-search component.

Expected behavior

Each element should be projected in the correct ng-content outlet.

Metadata

Metadata

Labels

Type

Projects

Status

🏗 In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions