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

Unified Diff: third_party/pkg/js/example/jsonp/jsonp.dart

Issue 176943008: Update the Angular/DI tests to latest from github. (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 side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/js/example/jsonp/jsonp.dart
diff --git a/samples/jsonp/web/index.dart b/third_party/pkg/js/example/jsonp/jsonp.dart
similarity index 70%
copy from samples/jsonp/web/index.dart
copy to third_party/pkg/js/example/jsonp/jsonp.dart
index bbcedac86e47d965edaa930e5f36fadb307b25ad..1b5371e390600b7feb1f8be6c14f22a10bef561e 100644
--- a/samples/jsonp/web/index.dart
+++ b/third_party/pkg/js/example/jsonp/jsonp.dart
@@ -1,11 +1,8 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
library jsonp_sample;
import 'dart:html';
-import 'dart:js';
+
+import 'package:js/js.dart';
const List<String> FIELDS = const ['name', 'description', 'size',
'watchers', 'forks'];
@@ -20,13 +17,13 @@ addTableHeadRow() {
table.querySelector('thead').append(tr);
}
-addTableBodyRow(JsObject repo) {
+addTableBodyRow(Proxy repo) {
var tr = new TableRowElement();
for (var field in FIELDS) {
var td = new TableCellElement();
if (field == 'name') {
td.append(new AnchorElement()
- ..href = repo['html_url']
+ ..href = repo.html_url
..text = repo[field]);
} else {
td.text = repo[field].toString();
@@ -38,10 +35,10 @@ addTableBodyRow(JsObject repo) {
void main() {
// Create a jsObject to handle the response.
- context['processData'] = (response) {
+ context.processData = (response) {
addTableHeadRow();
- for (var repo in response['data']) {
- addTableBodyRow(repo);
+ for (var i = 0; i < response.data.length; i++) {
+ addTableBodyRow(response.data[i]);
}
};

Powered by Google App Engine
This is Rietveld 408576698