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

Commit

Permalink
fix(typeahead): remove dependency on ng-bind-html-unsafe
Browse files Browse the repository at this point in the history
Closes #813
  • Loading branch information
pkozlowski-opensource committed Sep 3, 2013
1 parent c0215c8 commit 7589339
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/bindHtml/bindHtml.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module('ui.bootstrap.bindHtml', [])

.directive('bindHtmlUnsafe', function () {
return function (scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);
scope.$watch(attr.bindHtmlUnsafe, function bindHtmlUnsafeWatchAction(value) {
element.html(value || '');
});
};
});
2 changes: 1 addition & 1 deletion src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* function, placement as a function, inside, support for more triggers than
* just mouse enter/leave, html tooltips, and selector delegation.
*/
angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position' ] )
angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap.bindHtml' ] )

/**
* The $tooltip service creates tooltip- and popover-like directives as well as
Expand Down
2 changes: 1 addition & 1 deletion src/typeahead/typeahead.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position'])
angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.position', 'ui.bootstrap.bindHtml'])

/**
* A helper service that can parse typeahead's syntax (string provided by users)
Expand Down
2 changes: 1 addition & 1 deletion template/typeahead/typeahead-match.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a tabindex="-1" ng-bind-html-unsafe="match.label | typeaheadHighlight:query"></a>
<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>

0 comments on commit 7589339

Please sign in to comment.