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

Side by Side Diff: samples/survey/lib/models.dart

Issue 27618002: package:observe fix various api issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 survey.models; 5 library survey.models;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 8
9 final appModel = new SurveyApp(); 9 final appModel = new SurveyApp();
10 10
11 /* 11 /*
12 * The model for the SurveyApp. 12 * The model for the SurveyApp.
13 */ 13 */
14 class SurveyApp extends ObservableBase { 14 class SurveyApp extends Observable {
15 @observable String title = ''; 15 @observable String title = '';
16 @observable String description = ''; 16 @observable String description = '';
17 @observable List<Question> questions; 17 @observable List<Question> questions;
18 18
19 SurveyApp(); 19 SurveyApp();
20 } 20 }
21 21
22 /* 22 /*
23 * Model for a survey question. [answerOptions] is the list of options from 23 * Model for a survey question. [answerOptions] is the list of options from
24 * which the user picks one or more [answers]. 24 * which the user picks one or more [answers].
25 */ 25 */
26 class Question extends ObservableBase { 26 class Question extends Observable {
27 @observable String text; 27 @observable String text;
28 @observable String helpText; 28 @observable String helpText;
29 @observable List<String> answerOptions = []; 29 @observable List<String> answerOptions = [];
30 @observable List<String> answers = []; 30 @observable List<String> answers = [];
31 31
32 Question([this.text = '', this.helpText = '']); 32 Question([this.text = '', this.helpText = '']);
33 33
34 bool get isValid => text.isNotEmpty; 34 bool get isValid => text.isNotEmpty;
35 } 35 }
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/test/syntax_test.dart ('k') | samples/survey/web/elements/question/question_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698