Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor Service is shared if used in a extended custom component #228

Open
Venipa opened this issue Aug 13, 2021 · 0 comments
Open

Anchor Service is shared if used in a extended custom component #228

Venipa opened this issue Aug 13, 2021 · 0 comments

Comments

@Venipa
Copy link
Contributor

Venipa commented Aug 13, 2021

so for example i've created my own component by extending the popover class like this:
export class MyCustomComponentPopover extends SatPopover implements OnInit

but the anchoring service will conflict with the next instantiated custom popover if loaded in the same module.
so if i load MyCustomComponentPopoverA & MyCustomComponentPopoverB in the same module the service will always pick MyCustomComponentPopoverB as the Popover which results in MyCustomComponentPopoverA opening MyCustomComponentPopoverB.

to fix this you'll need to provide the anchoring service anew but without using an existing anchoring service:

@Component({
  selector: 'app-my-custom-component-popover-a',
  providers: [{ provide: SatPopoverAnchoringService, useExisting: false }]
})
export class MyCustomComponentPopoverA extends SatPopover implements OnInit {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant