OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'dart:html'; | 7 import 'dart:html'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'package:observatory/models.dart' | 9 import 'package:observatory/models.dart' show ErrorRef; |
10 show ErrorRef; | |
11 import 'package:observatory/src/elements/helpers/tag.dart'; | 10 import 'package:observatory/src/elements/helpers/tag.dart'; |
12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
13 | 12 |
14 class ErrorRefElement extends HtmlElement implements Renderable { | 13 class ErrorRefElement extends HtmlElement implements Renderable { |
15 static const tag = const Tag<ErrorRefElement>('error-ref'); | 14 static const tag = const Tag<ErrorRefElement>('error-ref'); |
16 | 15 |
17 RenderingScheduler<ErrorRefElement> _r; | 16 RenderingScheduler<ErrorRefElement> _r; |
18 | 17 |
19 Stream<RenderedEvent<ErrorRefElement>> get onRendered => _r.onRendered; | 18 Stream<RenderedEvent<ErrorRefElement>> get onRendered => _r.onRendered; |
20 | 19 |
(...skipping 18 matching lines...) Expand all Loading... |
39 } | 38 } |
40 | 39 |
41 @override | 40 @override |
42 void detached() { | 41 void detached() { |
43 super.detached(); | 42 super.detached(); |
44 children = []; | 43 children = []; |
45 _r.disable(notify: true); | 44 _r.disable(notify: true); |
46 } | 45 } |
47 | 46 |
48 void render() { | 47 void render() { |
49 children = [ | 48 children = [new PreElement()..text = error.message]; |
50 new PreElement()..text = error.message | |
51 ]; | |
52 } | 49 } |
53 } | 50 } |
OLD | NEW |