Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2bd3214

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 #8519
1 parent fc2abef commit 2bd3214

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
@@ -382,15 +382,17 @@ See [80739409](https://github.com/angular/angular.js/commit/807394095b991357225a
382382

383383
## ngBindHtmlUnsafe has been removed and replaced by ngBindHtml
384384

385-
`ngBindHtml` which has been moved from `ngSanitize` module to the core `ng` module.
386-
387385
`ngBindHtml` provides `ngBindHtmlUnsafe` like
388386
behavior (evaluate an expression and innerHTML the result into the DOM) when bound to the result
389387
of `$sce.trustAsHtml(string)`. When bound to a plain string, the string is sanitized via
390388
`$sanitize` before being innerHTML'd. If the `$sanitize` service isn't available (`ngSanitize`
391389
module is not loaded) and the bound expression evaluates to a value that is not trusted an
392390
exception is thrown.
393391

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

396398

0 commit comments

Comments
 (0)