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

Side by Side Diff: third_party/pkg/route_hierarchical/example/full/data.dart

Issue 180873006: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback Created 6 years, 10 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
(Empty)
1 /**
2 * Mock implementation of the data service library.
3 */
4 library dataservice;
5
6 import 'dart:async';
7
8 // List of fake companies
9 List _companies = [
10 {
11 'id': 100001,
12 'name': 'Company 100001',
13 'revenue': 3000000.00
14 },
15 {
16 'id': 111111,
17 'name': 'Company 1111111',
18 'revenue': 1001100.00
19 },
20 {
21 'id': 100003,
22 'name': 'Mom & Pop Shop',
23 'revenue': 201000.00
24 },
25 {
26 'id': 333333,
27 'name': 'Sunny & Bob',
28 'revenue': 301000.00
29 },
30 {
31 'id': 444444,
32 'name': 'Sun In the Sky Inc.',
33 'revenue': 5001000.00
34 },
35 {
36 'id': 555555,
37 'name': 'Sunny Java',
38 'revenue': 401000.00
39 }
40 ];
41
42 /// simulate an RPC call to fetch companies
43 Future<List<Map>> fetchCompanies(String query) =>
44 new Future.delayed(new Duration(milliseconds: 500), () =>
45 _companies.where((company) =>
46 company['name'].toLowerCase().indexOf(query.toLowerCase()) > -1));
47
48 /// simulate an RPC call to fetch a company
49 Future<Map> fetchCompany(int id) =>
50 new Future.delayed(new Duration(seconds: 1), () =>
51 _companies.firstWhere((c) => c['id'] == id, orElse: () => null));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698