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

feat(popover): allow passing custom data to show() method for popovers #2853

Open
kahboom opened this issue Oct 16, 2017 · 2 comments
Open

Comments

@kahboom
Copy link

kahboom commented Oct 16, 2017

Bug description or feature request:

There is a related issue open for passing custom content to the hide method for the ModalService (#2330). Although popovers do not currently have a service (maybe they should?), we should still be able to pass custom content to the show method of the PopoverDirective, similarly to how ng-bootstrap does: https://ng-bootstrap.github.io/#/components/popover/api

A use case for this is facility in writing plugins for third-party apps, such as ngx-tour. I think there is a way around this by using anonymous arrow functions, but have not tested it yet. Either way, it would make life a lot easier if this were possible.

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 1.9.1

Angular: 4.4.2

Build system: Angular CLI, System.js, webpack, starter seed:

Angular-CLI: 1.2.x

@kahboom
Copy link
Author

kahboom commented Oct 18, 2017

In case it helps anyone, my workaround in the meantime was to set it like this, using popoverContext:

this.popover = this.template; // Some popover template.
this.popoverContext = { data }; // Some content being passed to the popover
this.popoverTitle = this.title; // Some title for the popover

@valorkin
Copy link
Member

valorkin commented Nov 6, 2017

Services is a planned feature, context too

@YevheniiaMazur YevheniiaMazur changed the title Allow passing custom data to show() method for popovers feat(popover): allow passing custom data to show() method for popovers Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants