Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: third_party/pkg/angular/lib/directive/ng_bind_html.dart

Issue 257423008: Update all Angular libs (run update_all.sh). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of angular.directive; 1 part of angular.directive;
2 2
3 /** 3 /**
4 * Creates a binding that will innerHTML the result of evaluating the 4 * Creates a binding that will innerHTML the result of evaluating the
5 * `expression` bound to `ng-bind-html` into the current element in a secure 5 * `expression` bound to `ng-bind-html` into the current element in a secure
6 * way. This expression must evaluate to a string. The innerHTML-ed content 6 * way. This expression must evaluate to a string. The innerHTML-ed content
7 * will be sanitized using a default [NodeValidator] constructed as `new 7 * will be sanitized using a default [NodeValidator] constructed as `new
8 * dom.NodeValidatorBuilder.common()`. In a future version, when Strict 8 * dom.NodeValidatorBuilder.common()`. In a future version, when Strict
9 * Contextual Escaping support has been added to Angular.dart, this directive 9 * Contextual Escaping support has been added to Angular.dart, this directive
10 * will allow one to bypass the sanitizaton and innerHTML arbitrary trusted 10 * will allow one to bypass the sanitization and innerHTML arbitrary trusted
11 * HTML. 11 * HTML.
12 * 12 *
13 * Example: 13 * Example:
14 * 14 *
15 * <div ng-bind-html="htmlVar"></div> 15 * <div ng-bind-html="htmlVar"></div>
16 */ 16 */
17 @NgDirective( 17 @Decorator(
18 selector: '[ng-bind-html]', 18 selector: '[ng-bind-html]',
19 map: const {'ng-bind-html': '=>value'}) 19 map: const {'ng-bind-html': '=>value'})
20 class NgBindHtmlDirective { 20 class NgBindHtml {
21 final dom.Element element; 21 final dom.Element element;
22 final dom.NodeValidator validator; 22 final dom.NodeValidator validator;
23 23
24 NgBindHtmlDirective(this.element, dom.NodeValidator this.validator); 24 NgBindHtml(this.element, dom.NodeValidator this.validator);
25 25
26 /** 26 /**
27 * Parsed expression from the `ng-bind-html` attribute.  The result of this 27 * Parsed expression from the `ng-bind-html` attribute.  The result of this
28 * expression is innerHTML'd according to the rules specified in this class' 28 * expression is innerHTML'd according to the rules specified in this class'
29 * documentation. 29 * documentation.
30 */ 30 */
31 set value(value) => element.setInnerHtml(value == null ? '' : value.toString() , 31 void set value(value) => element.setInnerHtml(
32 validator: validator); 32 value == null ? '' : value.toString(), validator: validator);
33 } 33 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_bind.dart ('k') | third_party/pkg/angular/lib/directive/ng_bind_template.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698