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

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

Issue 957883002: add @CustomElement (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: update pubspec/changelog and add some comments Created 5 years, 9 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
« no previous file with comments | « CHANGELOG.md ('k') | lib/web_components.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 library web_components.custom_element;
5
6 import 'dart:html' show document;
7 import 'package:initialize/initialize.dart';
8
9 /// Annotation which registers a custom element with the main document.
10 class CustomElement implements Initializer<Type> {
11 /// The tag you want to register the class to handle.
12 final String tag;
13
14 /// If this element extends a native html element, then this is the tag that
15 /// represents that element.
16 final String extendsTag;
17
18 const CustomElement(this.tag, {this.extendsTag});
19
20 void initialize(Type t) =>
21 document.registerElement(tag, t, extendsTag: extendsTag);
22 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/web_components.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698