Skip to content

Instantly share code, notes, and snippets.

@bradgignac
Last active August 29, 2015 14:03
Show Gist options
  • Save bradgignac/7286c05b87d780e420c0 to your computer and use it in GitHub Desktop.
Save bradgignac/7286c05b87d780e420c0 to your computer and use it in GitHub Desktop.
rs-tooltip

Usage

This package provides a single directive, rs-tooltip, that can be used as an element or an attribute.

<rs-tooltip text="This is my text.">I need a tooltip.</rs-tooltip>
<rs-tooltip html="<b>HTML works, too!</b>">I need one, too.</rs-tooltip>

Attributes

text

Accepts any string to be displayed as a tooltip when the element receives the hover event. Input to this directive is escaped.

html

Accepts any string to be displayed as a tooltip when the element receives the hover event. Input to this directive is not escaped. Use caution when using this directive as it can leave you vulnerable to a number of different injection attacks.

@bradgignac
Copy link
Author

Alternatively, we could always use an attribute like:

<p rs-tooltip-text="foo">Hi</p>
<p rs-tooltip-html="<b>html!</b>">More</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment