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

Commit 8ae1a76

Browse files
committed
chore(bindHtml): add deprecation notice
- Add deprecation notice for bindHtmlUnsafe Closes #3974 Closes #3574
1 parent cc66a06 commit 8ae1a76

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/bindHtml/bindHtml.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
angular.module('ui.bootstrap.bindHtml', [])
22

3-
.directive('bindHtmlUnsafe', function () {
3+
.value('$bindHtmlUnsafeSuppressDeprecated', false)
4+
5+
.directive('bindHtmlUnsafe', ['$log', '$bindHtmlUnsafeSuppressDeprecated', function ($log, $bindHtmlUnsafeSuppressDeprecated) {
46
return function (scope, element, attr) {
7+
if (!$bindHtmlUnsafeSuppressDeprecated) {
8+
$log.warn('bindHtmlUnsafe is now deprecated. Use ngBindHtml instead');
9+
}
510
element.addClass('ng-binding').data('$binding', attr.bindHtmlUnsafe);
611
scope.$watch(attr.bindHtmlUnsafe, function bindHtmlUnsafeWatchAction(value) {
712
element.html(value || '');
813
});
914
};
10-
});
15+
}]);

0 commit comments

Comments
 (0)