Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Added support for popover-html directive for binding html #1660

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

The popover component in Bootstrap supports using html as your content. This proposed fix creates a new directive, popoverHtml to support this new behavior. You can observe this directive at work here.

It modifies the tooltip script to conditionally choose the template used depending on whether an optional fourth flag is true.

There is a caveat of some code duplication due to reusing most of the HTML from the current popover directive.

It may not be the ideal implementation, and would like thoughts on this. However, I believe that it would be ideal to try to offer this capability for popovers, simply since the current non-support is a regression.

@wesleycho
Copy link
Contributor Author

Looks like I need to clean this up some - I would like some comments on the caveats. I probably did not implement it in a good way here.

Edit: Looks like I figured out a better implementation, by offering an optional flag in the $tooltip service.

Modified tooltip to support new popoverHtml

Readded forgotten fix to prefix for popover-html

Switched to correct unsafe html binding directive

Refactored and added a flag that can be passed as an optional fourth value in $tooltip for unsafe html binding

Fix spec

Returned template setting to original location

Removed extra whitespace

Condensed test to one meaningful test of rendering properly

Changed the test

Fix up test

Hopefully the true test fix

Removed extra check
@wesleycho
Copy link
Contributor Author

I think #1848 is a cleaner implementation, I will defer to that PR.

@wesleycho wesleycho closed this Apr 23, 2014
@wesleycho wesleycho deleted the popover_html branch August 2, 2015 07:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant