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

Commit 7ba30fd

Browse files
CWSpearcaitp
authored andcommitted
docs($sce): correct documentation for angular 1.2.0
Include mention of `ngSanitize` (and add it to the example), as well as removing (and clarifying if needed) references to `ng-html-bind-unsafe`. Closes #5551
1 parent 5adea0b commit 7ba30fd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: src/ng/sce.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function $SceDelegateProvider() {
275275
*
276276
* @description
277277
* Returns an object that is trusted by angular for use in specified strict
278-
* contextual escaping contexts (such as ng-html-bind-unsafe, ng-include, any src
278+
* contextual escaping contexts (such as ng-bind-html, ng-include, any src
279279
* attribute interpolation, any dom event binding attribute interpolation
280280
* such as for onclick, etc.) that uses the provided value.
281281
* See {@link ng.$sce $sce} for enabling strict contextual escaping.
@@ -502,8 +502,8 @@ function $SceDelegateProvider() {
502502
* It's important to remember that SCE only applies to interpolation expressions.
503503
*
504504
* If your expressions are constant literals, they're automatically trusted and you don't need to
505-
* call `$sce.trustAs` on them. (e.g.
506-
* `<div ng-html-bind-unsafe="'<b>implicitly trusted</b>'"></div>`) just works.
505+
* call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.
506+
* `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works.
507507
*
508508
* Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them
509509
* through {@link ng.$sce#methods_getTrusted $sce.getTrusted}. SCE doesn't play a role here.
@@ -563,7 +563,7 @@ function $SceDelegateProvider() {
563563
* matched against the **entire** *normalized / absolute URL* of the resource being tested
564564
* (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags
565565
* present on the RegExp (such as multiline, global, ignoreCase) are ignored.
566-
* - If you are generating your Javascript from some other templating engine (not
566+
* - If you are generating your JavaScript from some other templating engine (not
567567
* recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),
568568
* remember to escape your regular expression (and be aware that you might need more than
569569
* one level of escaping depending on your templating engine and the way you interpolated
@@ -580,7 +580,7 @@ function $SceDelegateProvider() {
580580
* ## Show me an example using SCE.
581581
*
582582
* @example
583-
<example module="mySceApp">
583+
<example module="mySceApp" deps="angular-sanitize.js">
584584
<file name="index.html">
585585
<div ng-controller="myAppController as myCtrl">
586586
<i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br>
@@ -805,8 +805,8 @@ function $SceProvider() {
805805
*
806806
* @description
807807
* Delegates to {@link ng.$sceDelegate#methods_trustAs `$sceDelegate.trustAs`}. As such,
808-
* returns an objectthat is trusted by angular for use in specified strict contextual
809-
* escaping contexts (such as ng-html-bind-unsafe, ng-include, any src attribute
808+
* returns an object that is trusted by angular for use in specified strict contextual
809+
* escaping contexts (such as ng-bind-html, ng-include, any src attribute
810810
* interpolation, any dom event binding attribute interpolation such as for onclick, etc.)
811811
* that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual
812812
* escaping.

0 commit comments

Comments
 (0)