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

Side by Side Diff: third_party/pkg/angular/lib/directive/ng_template.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 * The [NgTemplateElementDirective] allows one to preload an Angular template 4 * The [NgTemplate] allows one to preload an Angular template
5 * into the [TemplateCache]. It works on `<template>` and `<script>` elements 5 * into the [TemplateCache]. It works on `<template>` and `<script>` elements
6 * that have `type="text/ng-template`. For such elements, The entire contents 6 * that have `type="text/ng-template`. For such elements, The entire contents
7 * of the elements are loaded into the [TemplateCache] under the URL specified 7 * of the elements are loaded into the [TemplateCache] under the URL specified
8 * by the `id` attribute. 8 * by the `id` attribute.
9 * 9 *
10 * Sample usage: 10 * Sample usage:
11 * 11 *
12 * <template id="template_1.html" type="text/ng-template"> 12 * <template id="template_1.html" type="text/ng-template">
13 * TEMPLATE 1 CONTENTS 13 * TEMPLATE 1 CONTENTS
14 * </template> 14 * </template>
15 * <script id="template_2.html" type="text/ng-template"> 15 * <script id="template_2.html" type="text/ng-template">
16 * TEMPLATE 2 CONTENTS 16 * TEMPLATE 2 CONTENTS
17 * </template> 17 * </template>
18 * 18 *
19 * Refer [TemplateCache] for a **full example** as well as more information. 19 * Refer [TemplateCache] for a **full example** as well as more information.
20 */ 20 */
21 @NgDirective( 21 @Decorator(
22 selector: 'template[type=text/ng-template]', 22 selector: 'template[type=text/ng-template]',
23 map: const {'id': '@templateUrl'}) 23 map: const {'id': '@templateUrl'})
24 @NgDirective( 24 @Decorator(
25 selector: 'script[type=text/ng-template]', 25 selector: 'script[type=text/ng-template]',
26 children: NgAnnotation.IGNORE_CHILDREN, 26 children: Directive.IGNORE_CHILDREN,
27 map: const {'id': '@templateUrl'}) 27 map: const {'id': '@templateUrl'})
28 class NgTemplateDirective { 28 class NgTemplate {
29 final dom.Element element; 29 final dom.Element element;
30 final TemplateCache templateCache; 30 final TemplateCache templateCache;
31 31
32 NgTemplateDirective(this.element, this.templateCache); 32 NgTemplate(this.element, this.templateCache);
33 set templateUrl(url) => templateCache.put(url, new HttpResponse(200, 33 set templateUrl(url) => templateCache.put(url, new HttpResponse(200,
34 element is dom.TemplateElement 34 element is dom.TemplateElement
35 ? (element as dom.TemplateElement).content.innerHtml 35 ? (element as dom.TemplateElement).content.innerHtml
36 : element.innerHtml)); 36 : element.innerHtml));
37 } 37 }
38
39
OLDNEW
« no previous file with comments | « third_party/pkg/angular/lib/directive/ng_switch.dart ('k') | third_party/pkg/angular/lib/filter/currency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698