-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Context in popovers #1145
Context in popovers #1145
Conversation
Could you please share motivation for this change? Also please note that we can't merge any PRs without associated tests so adding those would be mandatory. But yeh, before speaking about tests I would like to hear more about a use-case... |
I'm writing a product tour library - ng2-tour I need to be able to pass in a template for the popover content that can have the context values inserted when the popover is shown. You can see in the demo page that the same template is used for all the tour steps, but the content text is different. The template looks like this: <template #tourStep let-step="step">
<p class="tour-step-content">{{step?.content}}</p>
<div class="tour-step-navigation">
// buttons, etc, go here...
</div>
</template> That |
I see, make sense. For this PR to go forward it would need:
Are you willing to put more work into it to push it forward? |
Working on it now. Can you point me to the tooltip/documentation files that need updated? I figure you know the organization better than I do. |
Documentation is in tooltip / popover files (jsdoc). This is where you would have to document new Thnx! |
I added tests and docs. There weren't any new @inputs, just an optional new parameter to the open() function. The popover and tooltip pages now document the new optional context parameter and there's a new demo section on each page. |
Any feedback on the tests/docs? |
@@ -0,0 +1,22 @@ | |||
import { NgbPopover } from './../../../../../../../src/popover/popover'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong import
@@ -0,0 +1,22 @@ | |||
import { NgbTooltip } from './../../../../../../../src/tooltip/tooltip'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong import
@isaacplmann could you please:
|
Changed the imports to import from '@ng-bootstrap/ng-bootstrap'. And squashed the commits into one. |
@isaacplmann I was trying to pull in this change but the demo site fails with the following errors (there are similar ones for popovers):
I guess that the root cause is #779 so let me prepare a PR that exports all the directive instances. Then you will be able to rebase on top of it and things should work. Unless you want to take a stab at #779? |
It looks like you're already fixing this in #1154 . If you merge that into master, I'll rebase this PR. |
@isaacplmann #1154 landed, please rebase. |
Rebased. And the demo now works. |
Merged, thnx! |
I added the ability to pass context into popover templates.