Chromium Code Reviews

Side by Side Diff: packages/web_components/lib/src/custom_element.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « packages/web_components/lib/polyfill.dart ('k') | packages/web_components/lib/src/init.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library web_components.custom_element; 4 library web_components.custom_element;
5 5
6 import 'dart:html' show document; 6 import 'dart:html' show document;
7 import 'package:initialize/initialize.dart'; 7 import 'package:initialize/initialize.dart';
8 8
9 /// Annotation which registers a custom element with the main document. 9 /// Annotation which registers a custom element with the main document.
10 class CustomElement implements Initializer<Type> { 10 class CustomElement implements Initializer<Type> {
11 /// The tag you want to register the class to handle. 11 /// The tag you want to register the class to handle.
12 final String tag; 12 final String tag;
13 13
14 /// If this element extends a native html element, then this is the tag that 14 /// If this element extends a native html element, then this is the tag that
15 /// represents that element. 15 /// represents that element.
16 final String extendsTag; 16 final String extendsTag;
17 17
18 const CustomElement(this.tag, {this.extendsTag}); 18 const CustomElement(this.tag, {this.extendsTag});
19 19
20 void initialize(Type t) => 20 void initialize(Type t) =>
21 document.registerElement(tag, t, extendsTag: extendsTag); 21 document.registerElement(tag, t, extendsTag: extendsTag);
22 } 22 }
OLDNEW
« no previous file with comments | « packages/web_components/lib/polyfill.dart ('k') | packages/web_components/lib/src/init.dart » ('j') | no next file with comments »

Powered by Google App Engine