Skip to content

Commit d978760

Browse files
committed
chore(bindHtml): add deprecation notice
- Add deprecation notice for bindHtmlUnsafe Closes angular-ui#3574
1 parent 2332f14 commit d978760

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bindHtml/bindHtml.js

Lines changed: 7 additions & 2 deletions
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)