OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
4 for details. All rights reserved. Use of this source code is governed by a | 4 for details. All rights reserved. Use of this source code is governed by a |
5 BSD-style license that can be found in the LICENSE file. | 5 BSD-style license that can be found in the LICENSE file. |
6 --> | 6 --> |
7 <html lang="en"> | 7 <html lang="en"> |
8 <head> | 8 <head> |
9 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
11 <script type="application/javascript" src="testing.js"></script> | 11 <script type="application/javascript" src="testing.js"></script> |
12 </head> | 12 </head> |
13 <body> | 13 <body> |
14 <element name="x-base" extends="div" constructor="Base"> | 14 <element name="x-base" extends="div" constructor="Base"> |
15 <template> | 15 <template> |
16 <p>Here are the lifecycle methods that have been called:</p> | 16 <p>Here are the lifecycle methods that have been called:</p> |
17 <pre>{{status}}</pre> | 17 <pre>{{status}}</pre> |
18 <p>You should see Base created, Base inserted.</p> | 18 <p>You should see Base created, Base inserted.</p> |
19 <p>Also, here is a message from Derived:</p> | 19 <p>Also, here is a message from Derived:</p> |
20 </template> | 20 </template> |
21 <script type="application/dart"> | 21 <script type="application/dart"> |
22 import 'package:web_components/web_components.dart'; | 22 import 'package:web_ui/web_ui.dart'; |
23 class Base extends WebComponent { | 23 class Base extends WebComponent { |
24 String status = ''; | 24 String status = ''; |
25 created() { | 25 created() { |
26 status = '${status}\nBase.created'; | 26 status = '${status}\nBase.created'; |
27 } | 27 } |
28 inserted() { | 28 inserted() { |
29 status = '${status}\nBase.inserted'; | 29 status = '${status}\nBase.inserted'; |
30 } | 30 } |
31 } | 31 } |
32 </script> | 32 </script> |
33 </element> | 33 </element> |
34 <element name="x-derived" extends="x-base" constructor="Derived"> | 34 <element name="x-derived" extends="x-base" constructor="Derived"> |
35 <template> | 35 <template> |
36 <shadow></shadow> | 36 <shadow></shadow> |
37 <p>Hello, I am a Derived element with no script tag!</p> | 37 <p>Hello, I am a Derived element with no script tag!</p> |
38 </template> | 38 </template> |
39 </element> | 39 </element> |
40 <div is="x-derived"></div> | 40 <div is="x-derived"></div> |
41 <script type="application/dart"> | 41 <script type="application/dart"> |
42 import 'common.dart'; | 42 import 'common.dart'; |
43 import 'dart:html'; | 43 import 'dart:html'; |
44 main() { | 44 main() { |
45 window.setTimeout(() => window.postMessage('done', '*'), 0); | 45 window.setTimeout(() => window.postMessage('done', '*'), 0); |
46 } | 46 } |
47 </script> | 47 </script> |
48 </body> | 48 </body> |
49 </html> | 49 </html> |
OLD | NEW |