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

Side by Side Diff: sky/tests/resources/test-element.sky

Issue 850383002: Add two way data binding. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Make it async. Created 5 years, 11 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 | « sky/tests/framework/templates-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Copyright 2014 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 --> 5 -->
6 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> 6 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" />
7 <import src="/sky/framework/sky-checkbox/sky-checkbox.sky" />
7 8
8 <sky-element 9 <sky-element
9 name="test-element" 10 name="test-element"
10 attributes="size:number, checked:boolean,name:string" 11 attributes="size:number, checked:boolean,name:string"
11 on-host-event="handleEvent"> 12 on-host-event="handleEvent">
12 <template> 13 <template>
13 <div id="inside" on-test-event="handleEvent" lang="{{ value }}">{{ value }}</d iv> 14 <div id="inside" on-test-event="handleEvent" lang="{{ value }}">{{ value }}</d iv>
15 <sky-checkbox id="checkbox" checked="{{ checked }}" />
14 </template> 16 </template>
15 <script> 17 <script>
16 module.exports = class extends SkyElement { 18 module.exports = class extends SkyElement {
17 created() { 19 created() {
18 this.lastEvent = null; 20 this.lastEvent = null;
19 this.value = 10; 21 this.value = 10;
20 this.shadowRootReadyCount = 0; 22 this.shadowRootReadyCount = 0;
21 this.changes = []; 23 this.changes = [];
22 } 24 }
23 handleEvent(event) { 25 handleEvent(event) {
(...skipping 14 matching lines...) Expand all
38 recordAttributeChange(name, oldValue, newValue) { 40 recordAttributeChange(name, oldValue, newValue) {
39 this.changes.push({ 41 this.changes.push({
40 name: name, 42 name: name,
41 newValue: newValue, 43 newValue: newValue,
42 oldValue: oldValue, 44 oldValue: oldValue,
43 }); 45 });
44 } 46 }
45 }.register(); 47 }.register();
46 </script> 48 </script>
47 </sky-element> 49 </sky-element>
OLDNEW
« no previous file with comments | « sky/tests/framework/templates-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698