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

Side by Side Diff: src/site/docs/tutorials/indexeddb/examples/count_down/out/web/xcountdown.dart

Issue 26542002: edit pass on T3,4,5, updated images (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: merging with master Created 7 years, 2 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
(Empty)
1 // Some things we need.
2 import 'package:polymer/polymer.dart';
3 import 'dart:html';
4 import 'dart:async';
5 import 'count_down.dart';
6
7 @CustomTag('x-count-down')
8 class CountDownComponent extends PolymerElement {
9
10 // Observe errorMsg.
11 // It displays a message for the user.
12 @observable String get errorMsg => __$errorMsg; String __$errorMsg = ''; set e rrorMsg(String value) { __$errorMsg = notifyPropertyChange(#errorMsg, __$errorMs g, value); }
13
14 // These are bound to input elements.
15 @observable String get newMilestoneName => __$newMilestoneName; String __$newM ilestoneName = "New Year's Day"; set newMilestoneName(String value) { __$newMile stoneName = notifyPropertyChange(#newMilestoneName, __$newMilestoneName, value); }
16 @observable String get newMilestoneDate => __$newMilestoneDate; String __$newM ilestoneDate = '2014-01-01'; set newMilestoneDate(String value) { __$newMileston eDate = notifyPropertyChange(#newMilestoneDate, __$newMilestoneDate, value); }
17 @observable String get newMilestoneTime => __$newMilestoneTime; String __$newM ilestoneTime = '00:00:00'; set newMilestoneTime(String value) { __$newMilestoneT ime = notifyPropertyChange(#newMilestoneTime, __$newMilestoneTime, value); }
18
19 @observable MilestoneApp get appObj => __$appObj; MilestoneApp __$appObj = app Object; set appObj(MilestoneApp value) { __$appObj = notifyPropertyChange(#appOb j, __$appObj, value); }
20
21 /*
22 * Click handlers.
23 * NOTE: Minus - button handler is in xmilestone web component.
24 */
25 // Plus + button click handler.
26 void addMilestone(Event e, var detail, Node target) {
27 String str = newMilestoneDate + ' ' + newMilestoneTime;
28 DateTime occursOn = DateTime.parse(str);
29
30 appObject.addMilestone(newMilestoneName, occursOn);
31 }
32
33 // Clear button click handler.
34 void clear(Event e, var detail, Node target) {
35 errorMsg = '';
36 appObject.clear();
37 }
38
39 /*
40 * Life-cycle bizness
41 */
42 void inserted() {
43 appObject.start()
44 .catchError((e) {
45 ($['addbutton'] as ButtonElement).disabled = true;
46 ($['clearbutton'] as ButtonElement).disabled = true;
47
48 errorMsg = e.toString();
49 });
50 }
51
52 void removed() {
53 appObject.stop();
54 }
55 } // end class
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698