diff --git a/src/tooltip/docs/demo.html b/src/tooltip/docs/demo.html index 09aa0ba496..914dc91ccd 100644 --- a/src/tooltip/docs/demo.html +++ b/src/tooltip/docs/demo.html @@ -20,6 +20,8 @@ fading at elementum eu, facilisis sed odio morbi quis commodo odio. In cursus delayed turpis massa tincidunt dui ut. + Custom template + nunc sed velit dignissim sodales ut eu sem integer vitae. Turpis egestas
@@ -58,4 +60,8 @@ tooltip-enable="!inputModel" /> + + diff --git a/src/tooltip/docs/readme.md b/src/tooltip/docs/readme.md index 960a7d154f..fcea6c11b0 100644 --- a/src/tooltip/docs/readme.md +++ b/src/tooltip/docs/readme.md @@ -1,11 +1,16 @@ A lightweight, extensible directive for fancy tooltip creation. The tooltip directive supports multiple placements, optional transition animation, and more. -There are two versions of the tooltip: `tooltip` and `tooltip-html-unsafe`. The -former takes text only and will escape any HTML provided. The latter takes -whatever HTML is provided and displays it in a tooltip; it's called "unsafe" -because the HTML is not sanitized. *The user is responsible for ensuring the -content is safe to put into the DOM!* +There are three versions of the tooltip: `tooltip`, `tooltip-template`, and +`tooltip-html-unsafe`: + +- `tooltip` takes text only and will escape any HTML provided. +- `tooltip-template` takes text that specifies the location of a template to + use for the tooltip. +- `tooltip-html-unsafe` takes + whatever HTML is provided and displays it in a tooltip; it's called "unsafe" + because the HTML is not sanitized. *The user is responsible for ensuring the + content is safe to put into the DOM!* The tooltip directives provide several optional attributes to control how they will display: diff --git a/src/tooltip/test/tooltip-template.spec.js b/src/tooltip/test/tooltip-template.spec.js new file mode 100644 index 0000000000..dab8d34863 --- /dev/null +++ b/src/tooltip/test/tooltip-template.spec.js @@ -0,0 +1,65 @@ +describe('tooltip template', function() { + var elm, + elmBody, + scope, + elmScope, + tooltipScope; + + // load the popover code + beforeEach(module('ui.bootstrap.tooltip')); + + // load the template + beforeEach(module('template/tooltip/tooltip-template-popup.html')); + + beforeEach(inject(function ($templateCache) { + $templateCache.put('myUrl', [200, '{{ myTemplateText }}', {}]); + })); + + beforeEach(inject(function($rootScope, $compile) { + elmBody = angular.element( + '