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

docs(ngBindHtml): Added important info to comment #9400

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ng/directive/ngBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate
* element in a secure way. By default, the innerHTML-ed content will be sanitized using the {@link
* ngSanitize.$sanitize $sanitize} service. To utilize this functionality, ensure that `$sanitize`
* is available, for example, by including {@link ngSanitize} in your module's dependencies (not in
* core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to
* core Angular). In order to use {@link ngSanitize} in your module's dependencies, you need to add "angular-sanitize.js" to your index.html.
* You may also bypass sanitization for values you know are safe. To do so, bind to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is adding much --- the specific instructions are only helpful to people under a specific configuration, and the real instructions for this are laid out more clearly in the tutorial

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it would have helped me to make it run. There was no info about the
file, how should one know? I found out on stackoverflow and was pissed off
enough to make that change. So please let others know, what is a comment
then for?
Am 02.10.2014 22:15 schrieb "Caitlin Potter" [email protected]:

In src/ng/directive/ngBind.js:

@@ -145,7 +145,8 @@ var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate

  • element in a secure way. By default, the innerHTML-ed content will be sanitized using the {@link
  • ngSanitize.$sanitize $sanitize} service. To utilize this functionality, ensure that $sanitize
  • is available, for example, by including {@link ngSanitize} in your module's dependencies (not in
    • * core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to
    • * core Angular). In order to use {@link ngSanitize} in your module's dependencies, you need to add "angular-sanitize.js" to your index.html.
    • * You may also bypass sanitization for values you know are safe. To do so, bind to

I don't think this change is adding much --- the specific instructions are
only helpful to people under a specific configuration, and the real
instructions for this are laid out more clearly in the tutorial


Reply to this email directly or view it on GitHub
https://github.com/angular/angular.js/pull/9400/files#r18364209.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, okay --- fair enough =) can we just change it slightly to simply explain that you need to include angular-sanitize.js? (leave inde.html/requirejs/browserify configuration/whatever else as an exercise for the reader)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure, as long as there is some info for people. I probably needed like an hour to figure out how to print out html in ng-repeat, which shouldn't be a big deal imo. I'm a beginner, so couldn't understand why such a small thing was so hard to achieve.

* an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example
* under {@link ng.$sce#Example Strict Contextual Escaping (SCE)}.
*
Expand Down