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

Side by Side Diff: lib/searchable_list.dart

Issue 688503004: Update searchable_list test to run in package bots (Closed) Base URL: git@github.com:dart-lang/searchable-list-sample.git@master
Patch Set: Created 6 years, 1 month 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 | « lib/demo_app.html ('k') | lib/searchable_list.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 searchable_list.searchable_list; 5 library searchable_list.searchable_list;
6 6
7 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
8 8
9 @CustomTag('searchable-list') 9 @CustomTag('searchable-list')
10 class SearchableList extends PolymerElement { 10 class SearchableList extends PolymerElement {
11 @observable bool applyAuthorStyles = true; 11 @observable bool applyAuthorStyles = true;
12 @observable String searchParam; 12 @observable String searchParam;
13 @published List<String> data = []; 13 @published List<String> data = [];
14 final List<String> results = toObservable([]); 14 final List<String> results = toObservable([]);
15 15
16 SearchableList.created() : super.created(); 16 SearchableList.created() : super.created();
17 17
18 attached() { 18 attached() {
19 super.attached(); 19 super.attached();
20 results.addAll(data); 20 results.addAll(data);
21 onPropertyChange(this, #searchParam, search); 21 onPropertyChange(this, #searchParam, search);
22 } 22 }
23 23
24 search() { 24 search() {
25 results.clear(); 25 results.clear();
26 String lower = searchParam.toLowerCase(); 26 String lower = searchParam.toLowerCase();
27 results.addAll(data.where((d) => d.toLowerCase().contains(lower))); 27 results.addAll(data.where((d) => d.toLowerCase().contains(lower)));
28 } 28 }
29 } 29 }
OLDNEW
« no previous file with comments | « lib/demo_app.html ('k') | lib/searchable_list.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698