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

Side by Side Diff: third_party/pkg/angular/demo/todo/web/main.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
1 import 'package:di/di.dart'; 1 import 'package:di/di.dart';
2 import 'package:angular/angular.dart'; 2 import 'package:angular/angular.dart';
3 import 'package:angular/playback/playback_http.dart'; 3 import 'package:angular/playback/playback_http.dart';
4 import 'todo.dart'; 4 import 'todo.dart';
5 5
6 import 'dart:html'; 6 import 'dart:html';
7 7
8 // Everything in the 'todo' library should be preserved by MirrorsUsed 8 // Everything in the 'todo' library should be preserved by MirrorsUsed.
9 @MirrorsUsed( 9 @MirrorsUsed(
10 targets: const['todo'], 10 targets: const ['todo'],
11 override: '*') 11 override: '*')
12 import 'dart:mirrors'; 12 import 'dart:mirrors';
13 13
14 main() { 14 main() {
15
16 print(window.location.search); 15 print(window.location.search);
17 var module = new Module() 16 var module = new Module()
18 ..type(TodoController) 17 ..type(TodoController)
19 ..type(PlaybackHttpBackendConfig); 18 ..type(PlaybackHttpBackendConfig);
20 19
21 // If these is a query in the URL, use the server-backed 20 // If these is a query in the URL, use the server-backed
22 // TodoController. Otherwise, use the stored-data controller. 21 // TodoController. Otherwise, use the stored-data controller.
23 var query = window.location.search; 22 var query = window.location.search;
24 if (query.contains('?')) { 23 if (query.contains('?')) {
25 module.type(ServerController); 24 module.type(ServerController, implementedBy: HttpServerController);
26 } else { 25 } else {
27 module.type(ServerController, implementedBy: NoServerController); 26 module.type(ServerController, implementedBy: NoServerController);
28 } 27 }
29 28
30 if (query == '?record') { 29 if (query == '?record') {
31 print('Using recording HttpBackend'); 30 print('Using recording HttpBackend');
32 var wrapper = new HttpBackendWrapper(new HttpBackend()); 31 var wrapper = new HttpBackendWrapper(new HttpBackend());
33 module.value(HttpBackendWrapper, new HttpBackendWrapper(new HttpBackend())); 32 module.value(HttpBackendWrapper, new HttpBackendWrapper(new HttpBackend()));
34 module.type(HttpBackend, implementedBy: RecordingHttpBackend); 33 module.type(HttpBackend, implementedBy: RecordingHttpBackend);
35 } 34 }
36 35
37 if (query == '?playback') { 36 if (query == '?playback') {
38 print('Using playback HttpBackend'); 37 print('Using playback HttpBackend');
39 module.type(HttpBackend, implementedBy: PlaybackHttpBackend); 38 module.type(HttpBackend, implementedBy: PlaybackHttpBackend);
40 } 39 }
41 40
42 ngBootstrap(module:module); 41 ngBootstrap(module: module);
43 } 42 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/demo/todo/web/index.html ('k') | third_party/pkg/angular/demo/todo/web/todo.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698