Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 0557c72

Browse files
chalinwardbell
authored andcommitted
chore(dart): updating to beta.16
closes #1192 Updated docs and samples to beta.16. For this first time, among other things, I payed particular attention to the changes that were made on the `ts` side of things (#1178). Since I wrote it up in my notes, here is the check list of `ts` updates with notes about how there might be corresponding changes on the Dart side: - public/docs/_examples/cb-dependency-injection/ts/app/main.ts - public/docs/_examples/cb-ts-to-js/ts/app/main.ts - cb not in Dart docs yet. - public/docs/_examples/dependency-injection/ts/app/car/car-injector.ts - public/docs/_examples/dependency-injection/ts/app/injector.component.ts - Updated Dart example code to avoid null argument. - public/docs/_examples/homepage-hello-world/ts/index.1.html - public/docs/_examples/homepage-tabs/ts/index.1.html - public/docs/_examples/homepage-todo/ts/index.1.html - public/docs/_examples/package.json - N/A for Dart. - public/docs/_examples/pipes/ts/app/app.component.html - public/docs/_examples/pipes/ts/app/app.component.ts - public/docs/_examples/pipes/ts/app/exponential-strength.pipe.ts - public/docs/_examples/pipes/ts/app/fetch-json.pipe.ts - public/docs/_examples/pipes/ts/app/random-pipe.component.ts - Dart version of sample code is incomplete, but did run in beta.15. - Example no longer runs, see angular/angular#8258 - public/docs/_examples/quickstart/js/package.1.json - public/docs/_examples/quickstart/ts/package.1.json - public/docs/_examples/router/ts/app/main.2.ts - public/docs/_examples/testing/ts/app/mock-router.ts - N/A for Dart. - public/docs/js/latest/_data.json - public/docs/ts/latest/_data.json - Dart equivalent updated. - public/docs/ts/latest/guide/dependency-injection.jade - No need to update since it imports the TS version. - public/docs/ts/latest/guide/pipes.jade - Not in Dart prose yet. - tools/plunker-builder/indexHtmlTranslator.js - N/A for Dart.
1 parent d5e909b commit 0557c72

File tree

23 files changed

+47
-48
lines changed

23 files changed

+47
-48
lines changed

public/docs/_examples/architecture/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/attribute-directives/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/dependency-injection/dart/lib/car/car_injector.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import 'car.dart';
77

88
//#docregion injector
99
Car useInjector() {
10-
Injector injector;
10+
ReflectiveInjector injector;
1111
//#enddocregion injector
1212

1313
/*
1414
//#docregion injector-no-new
15-
// Cannot 'new' an Injector like this!
16-
var injector = new Injector([Car, Engine, Tires, Logger]);
15+
// Cannot 'new' an ReflectiveInjector like this!
16+
var injector = new ReflectiveInjector([Car, Engine, Tires, Logger]);
1717
//#enddocregion injector-no-new
1818
*/
1919

2020
//#docregion injector
2121

2222
//#docregion injector-create-and-call
23-
injector = Injector.resolveAndCreate([Car, Engine, Tires, Logger]);
23+
injector = ReflectiveInjector.resolveAndCreate([Car, Engine, Tires, Logger]);
2424
//#docregion injector-call
2525
var car = injector.get(Car);
2626
//#enddocregion injector-call

public/docs/_examples/dependency-injection/dart/lib/injector_component.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ class InjectorComponent {
3131
Hero hero;
3232

3333
String get rodent {
34-
var rous = _injector.getOptional(ROUS);
35-
if (rous != null) {
36-
throw new Exception('Aaaargh!');
34+
try {
35+
_injector.get(ROUS);
36+
} on NoProviderError {
37+
return "R.O.U.S.'s? I don't think they exist!";
3738
}
38-
return "R.O.U.S.'s? I don't think they exist!";
39+
throw new Exception('Aaaargh!');
3940
}
4041

4142
InjectorComponent(this._injector) {

public/docs/_examples/dependency-injection/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/displaying-data/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/forms/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/hierarchical-dependency-injection/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/lifecycle-hooks/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/pipes/dart/lib/exponential_strength_pipe.dart

+12-18
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,18 @@ import 'dart:math' as math;
33
import 'package:angular2/angular2.dart';
44

55
/*
6-
* Raise the value exponentially
7-
* Takes a value that defaults to 0 and an exponent argument that defaults to 1.
8-
* Checks for value to be a string or number.
9-
* Usage:
10-
* value | exponentialStrength:exponent
11-
* Example:
12-
* {{ 2 | exponentialStrength:10}}
13-
* formats to: 1024
14-
*/
15-
6+
* Raise the value exponentially
7+
* Takes an exponent argument that defaults to 1.
8+
* Usage:
9+
* value | exponentialStrength:exponent
10+
* Example:
11+
* {{ 2 | exponentialStrength:10}}
12+
* formats to: 1024
13+
*/
1614
@Pipe(name: 'exponentialStrength')
17-
@Injectable()
15+
@Injectable() // FIXME(chalin): unnecessary?
1816
class ExponentialStrengthPipe extends PipeTransform {
19-
transform(dynamic value, [List<dynamic> args]) {
20-
var v = int.parse(value.toString(), onError: (source) => 0);
21-
var p = args.isEmpty
22-
? 1
23-
: int.parse(args.first.toString(), onError: (source) => 1);
24-
return math.pow(v, p);
25-
}
17+
num transform(num value, String exponent) =>
18+
math.pow(value,
19+
num.parse(exponent, onError: (_) => 1));
2620
}

public/docs/_examples/pipes/dart/lib/fetch_json_pipe.dart

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
1+
// #docregion
12
import 'dart:html';
23
import 'dart:async';
34
import 'dart:convert';
45

56
import 'package:angular2/angular2.dart';
67

8+
// #docregion pipe-metadata
79
@Pipe(name: 'fetch', pure: false)
8-
@Injectable()
10+
// #enddocregion pipe-metadata
11+
@Injectable() // FIXME(chalin): unnecessary?
912
class FetchJsonPipe extends PipeTransform {
1013
dynamic _fetchedValue;
1114
Future<dynamic> _fetchPromise;
12-
transform(dynamic value, [List<dynamic> args]) {
15+
16+
transform(String url) {
1317
if (_fetchPromise == null) {
1418
_fetchPromise = new Future(() async {
15-
_fetchedValue = JSON.decode(await HttpRequest.getString(value));
19+
_fetchedValue = JSON.decode(await HttpRequest.getString(url));
1620
});
1721
}
1822
return _fetchedValue;

public/docs/_examples/pipes/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/quickstart/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ version: 0.0.1
77
environment:
88
sdk: '>=1.13.0 <2.0.0'
99
dependencies:
10-
angular2: 2.0.0-beta.15
10+
angular2: 2.0.0-beta.16
1111
browser: ^0.10.0
1212
# #enddocregion no-rewriter
1313
dart_to_js_script_rewriter: ^1.0.1

public/docs/_examples/structural-directives/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/template-syntax/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/toh-1/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: 0.0.1
44
environment:
55
sdk: '>=1.13.0 <2.0.0'
66
dependencies:
7-
angular2: 2.0.0-beta.15
7+
angular2: 2.0.0-beta.16
88
browser: ^0.10.0
99
dart_to_js_script_rewriter: ^1.0.1
1010
transformers:

public/docs/_examples/toh-2/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.0.1
33
environment:
44
sdk: '>=1.13.0 <2.0.0'
55
dependencies:
6-
angular2: 2.0.0-beta.15
6+
angular2: 2.0.0-beta.16
77
browser: ^0.10.0
88
dart_to_js_script_rewriter: ^1.0.1
99
transformers:

public/docs/_examples/toh-3/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.0.1
33
environment:
44
sdk: '>=1.13.0 <2.0.0'
55
dependencies:
6-
angular2: 2.0.0-beta.15
6+
angular2: 2.0.0-beta.16
77
browser: ^0.10.0
88
dart_to_js_script_rewriter: ^1.0.1
99
transformers:

public/docs/_examples/toh-4/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.0.1
33
environment:
44
sdk: '>=1.13.0 <2.0.0'
55
dependencies:
6-
angular2: 2.0.0-beta.15
6+
angular2: 2.0.0-beta.16
77
browser: ^0.10.0
88
dart_to_js_script_rewriter: ^1.0.1
99
transformers:

public/docs/_examples/toh-5/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/_examples/user-input/dart/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: 0.0.1
55
environment:
66
sdk: '>=1.13.0 <2.0.0'
77
dependencies:
8-
angular2: 2.0.0-beta.15
8+
angular2: 2.0.0-beta.16
99
browser: ^0.10.0
1010
dart_to_js_script_rewriter: ^1.0.1
1111
transformers:

public/docs/dart/latest/_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"icon": "home",
44
"title": "Angular Docs",
55
"menuTitle": "Docs Home",
6-
"banner": "Welcome to <b>angular.io/dart</b>! The current Angular 2 release is <b>beta.15</b>. Consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'>Change Log</a> about recent enhancements, fixes, and breaking changes."
6+
"banner": "Welcome to <b>angular.io/dart</b>! The current Angular 2 release is <b>beta.16</b>. Consult the <a href='https://github.com/angular/angular/blob/master/CHANGELOG.md' target='_blank'>Change Log</a> about recent enhancements, fixes, and breaking changes."
77
},
88

99
"quickstart": {

public/docs/dart/latest/quickstart.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ p.
4141
specify the angular2 and browser packages as dependencies,
4242
as well as the angular2 transformer.
4343
Angular 2 is still changing, so provide an exact version:
44-
<b>2.0.0-beta.15</b>.
44+
<b>2.0.0-beta.16</b>.
4545

4646
+makeExample('quickstart/dart/pubspec.yaml', 'no-rewriter', 'pubspec.yaml')
4747

0 commit comments

Comments
 (0)