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

Commit 7589339

Browse files
fix(typeahead): remove dependency on ng-bind-html-unsafe
Closes #813
1 parent c0215c8 commit 7589339

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

src/bindHtml/bindHtml.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
angular.module('ui.bootstrap.bindHtml', [])
2+
3+
.directive('bindHtmlUnsafe', function () {
4+
return function (scope, element, attr) {
5+
element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);
6+
scope.$watch(attr.bindHtmlUnsafe, function bindHtmlUnsafeWatchAction(value) {
7+
element.html(value || '');
8+
});
9+
};
10+
});

src/tooltip/tooltip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* function, placement as a function, inside, support for more triggers than
44
* just mouse enter/leave, html tooltips, and selector delegation.
55
*/
6-
angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
6+
angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap.bindHtml' ] )
77

88
/**
99
* The $tooltip service creates tooltip- and popover-like directives as well as

src/typeahead/typeahead.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
1+
angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])
22

33
/**
44
* A helper service that can parse typeahead's syntax (string provided by users)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a tabindex="-1" ng-bind-html-unsafe="match.label | typeaheadHighlight:query"></a>
1+
<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>

0 commit comments

Comments
 (0)