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

Side by Side Diff: third_party/pkg/angular/demo/todo/main.dart

Issue 148453003: Updating Angular version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 import 'package:di/di.dart';
2 import 'package:angular/angular.dart';
3 import 'package:angular/playback/playback_http.dart';
4 import 'todo.dart';
5
6 import 'dart:html';
7
8 main() {
9
10 print(window.location.search);
11 var module = new Module()
12 ..type(TodoController)
13 ..type(PlaybackHttpBackendConfig);
14
15 // If these is a query in the URL, use the server-backed
16 // TodoController. Otherwise, use the stored-data controller.
17 var query = window.location.search;
18 if (query.contains('?')) {
19 module.type(ServerController);
20 } else {
21 module.type(ServerController, implementedBy: NoServerController);
22 }
23
24 if (query == '?record') {
25 print('Using recording HttpBackend');
26 var wrapper = new HttpBackendWrapper(new HttpBackend());
27 module.value(HttpBackendWrapper, new HttpBackendWrapper(new HttpBackend()));
28 module.type(HttpBackend, implementedBy: RecordingHttpBackend);
29 }
30
31 if (query == '?playback') {
32 print('Using playback HttpBackend');
33 module.type(HttpBackend, implementedBy: PlaybackHttpBackend);
34 }
35
36 ngBootstrap(module:module);
37 }
OLDNEW
« no previous file with comments | « third_party/pkg/angular/demo/todo/index.html ('k') | third_party/pkg/angular/demo/todo/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698