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

Side by Side Diff: runtime/observatory/lib/src/elements/error_ref.dart

Issue 2119733003: Wrapping leaf nodes in non polymer elements (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Converted error-ref tag Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 4
5 library error_ref_element; 5 library error_ref_element;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'dart:html';
8 import 'service_ref.dart'; 8 import 'package:observatory/repositories.dart'
9 show ErrorRef;
10 import 'package:observatory/src/elements/helpers/tag.dart';
9 11
10 @CustomTag('error-ref') 12 class ErrorRefElement extends HtmlElement {
11 class ErrorRefElement extends ServiceRefElement { 13 static const tag = const Tag<ErrorRefElement>('error-ref-wrapped');
14
15 ErrorRef _error;
16 ErrorRef get error => _error;
17
18 factory ErrorRefElement(ErrorRef error) {
19 assert(error != null);
20 ErrorRefElement e = document.createElement(tag.name);
21 e._error = error;
22 return e;
23 }
24
12 ErrorRefElement.created() : super.created(); 25 ErrorRefElement.created() : super.created();
26
27 @override
28 void attached() {
29 super.attached();
30 assert(error != null);
31 render();
32 }
33
34 void render() {
35 children = [
36 new PreElement()..text = error.message
37 ];
38 }
13 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698