Skip to content

Commit 07d5283

Browse files
juampynrcaitp
authored andcommitted
docs(guide/migration): ngSanitize is out ng core at AngularJS 1.2.21
When using ngBindHTML directive, either ngSanitize or $sce must be used or this will end in a non-trusted value error. Closes angular#8519
1 parent 7df7d1a commit 07d5283

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/content/guide/migration.ngdoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,17 @@ See [80739409](https://github.com/angular/angular.js/commit/807394095b991357225a
756756

757757
## ngBindHtmlUnsafe has been removed and replaced by ngBindHtml
758758

759-
`ngBindHtml` which has been moved from `ngSanitize` module to the core `ng` module.
760-
761759
`ngBindHtml` provides `ngBindHtmlUnsafe` like
762760
behavior (evaluate an expression and innerHTML the result into the DOM) when bound to the result
763761
of `$sce.trustAsHtml(string)`. When bound to a plain string, the string is sanitized via
764762
`$sanitize` before being innerHTML'd. If the `$sanitize` service isn't available (`ngSanitize`
765763
module is not loaded) and the bound expression evaluates to a value that is not trusted an
766764
exception is thrown.
767765

766+
When using this directive you can either include `ngSanitize` in your module's dependencis (See the
767+
example at the {@link ngBindHtml} reference) or use the {@link $sce} service to set the value as
768+
trusted.
769+
768770
See [dae69473](https://github.com/angular/angular.js/commit/dae694739b9581bea5dbc53522ec00d87b26ae55).
769771

770772

0 commit comments

Comments
 (0)