-
Notifications
You must be signed in to change notification settings - Fork 6.7k
add tooltip-html-unsafe directive #246
Comments
Thanks for opening this, @Skivvies. There is an outstanding tooltip pull request. As soon as that goes through (should be tomorrow-ish), this is what I'll work on. |
The directive displays the unsanitized HTML in the tooltip instead of the escaped text. The $tooltip service has been modified to allow a little more flexibility in terms of the prefix used on the $observe'd attributes. For example, the `tooltip-html-unsafe` directive needs to be called as written, but it would be nonsensical to require all other attributes (like animation or placement) to also use that verbose prefix as opposed to the simpler and more familiar `tooltip-` prefix. The service now allows independent specification of the name and its prefix. Lastly, the docs for the tooltip and popover have been updated to show their available optional attributes. Closes angular-ui#246
The directive displays the unsanitized HTML in the tooltip instead of the escaped text. The $tooltip service has been modified to allow a little more flexibility in terms of the prefix used on the $observe'd attributes. For example, the `tooltip-html-unsafe` directive needs to be called as written, but it would be nonsensical to require all other attributes (like animation or placement) to also use that verbose prefix as opposed to the simpler and more familiar `tooltip-` prefix. The service now allows independent specification of the name and its prefix. Lastly, the docs for the tooltip and popover have been updated to show their available optional attributes. Closes #246
ng-show does not work with your tooltip-html-unsafe. |
@mlunoe What do you mean? If you mean you can't pass ngShow into the tooltip as HTML, then you're right. The contents of the HTML are not compiled, so no AngularJS directives will work. This is meant for adding newlines with If you mean that |
Hi Josh. Sorry, it was a bit late for me when I commented and when you wrote me I if you are interested I wanted to show my stackoverflow score in the <a
class="stack-info" href="http://stackoverflow.com/users/1008519/mlunoe"
target="_blank" tooltip-placement="bottom" tooltip-html-unsafe=' <span
class="stack-info" ng-show="stackOverflow.score > 0">
{{stackOverflow.score}} </span> <span class="gold badgecount"
ng-show="stackOverflow.badge_counts.gold > 0"> <i class="icon-circle"></i>
{{stackOverflow.badge_counts.gold}} </span> <span class="silver badgecount"
ng-show="stackOverflow.badge_counts.silver > 0"> <i
class="icon-circle"></i> {{stackOverflow.badge_counts.silver}} </span>
<span class="bronze badgecount" ng-show="stackOverflow.badge_counts.bronze
> 0"> <i class="icon-circle"></i> {{stackOverflow.badge_counts.bronze}}
</span>'>
<i class="icon-stack-overflow icon-large"></i>
</a> And it works awesome :) The idea was to only show when there was actually any badges (that is e.g. So I am sorry about the comment as it was beyond the use of the tooltip Again, this was thoughts, however I think it could be kinda cool to explore Best regards, Michael On Tue, Apr 2, 2013 at 1:31 AM, Josh D Miller [email protected]:
|
Yeah, it's not really meant to show content that complicated. We've considered allowing passing in a template (e.g. If you want to explore using a template, open an issue and we can move the discussion there. |
Hi guys, |
See discussion in #154 and #202.
The text was updated successfully, but these errors were encountered: