Skip to content

Instantly share code, notes, and snippets.

@ejholmes
Last active January 4, 2016 08:09
Show Gist options
  • Save ejholmes/8593375 to your computer and use it in GitHub Desktop.
Save ejholmes/8593375 to your computer and use it in GitHub Desktop.
ngTooltip

ngTooltip

A modern angularjs directive/service for building tooltips and popovers.

Usage

As a directive

Best for simple tooltips.

Trigger on hover:

<a href="" ng-tooltip="Hello World" ng-tooltip-trigger="hover">Yo!</a>

Trigger manually:

<a href="" ng-tooltip="Hello World" ng-tooltip-trigger="manual" ng-tooltip-if="{{ error }}">Error!</a>

As a service

module.directive('myTooltip', function($tooltip) {
  return $tooltip('template/my-tooltip.html', {
    trigger: 'manual',
    if: "{{ error }}"
  });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment