docs(dart): update to b12

Also update dart_to_js_script_rewriter dependency to ^1.0.1,
and change most angular2.dart imports to be core.dart instead.

The pipes example broke without the angular2.dart import, so I let it be.

The server-communication sample has never worked for me,
so I changed it but might have broken it further.

closes #1007
This commit is contained in:
Kathy Walrath 2016-03-25 16:03:53 -07:00
parent 5f73911eaf
commit 185f9a7049
78 changed files with 97 additions and 96 deletions

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'logger_service.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docplaster
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_detail_component.dart';

View File

@ -1,4 +1,4 @@
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'backend_service.dart';
import 'hero.dart';

View File

@ -1,7 +1,7 @@
// #docregion
import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
/// A service for logging messages of various types.
///

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'highlight_directive.dart';

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion full
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Directive(selector: '[my-highlight]', host: const {
'(mouseenter)': 'onMouseEnter()',

View File

@ -1,7 +1,7 @@
// #docregion
library attribute_directives.highlight_directive;
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Directive(selector: '[my-highlight]')
class Highlight {

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Directive(selector: '[my-highlight]',
// #docregion host

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

View File

@ -7,7 +7,7 @@ environment:
dependencies:
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#COMMON_DIRECTIVES'

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Component(
selector: 'my-app',

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion mock-heroes
const List<String> _heroes = const [

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion heroes
import 'hero.dart';

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

View File

@ -1,7 +1,7 @@
// #docplaster
// #docregion
// #docregion no-todo
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Component(selector: 'hero-form', template: 'Hero form will go here')
class HeroFormComponent {}

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives:

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
class Hero {
String name;

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'restore_service.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'edit_item.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Injectable()
class RestoreService<T> {

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#COMMON_DIRECTIVES'

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'child_component.dart';
import 'logger_service.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'child_component.dart';
import 'logger_service.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'after_content_parent.dart';
import 'after_view_component.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Component(
selector: 'my-child',

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'logger_service.dart';
import 'spy_directive.dart';

View File

@ -1,6 +1,6 @@
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Injectable()
class LoggerService {

View File

@ -1,7 +1,7 @@
// #docregion
import 'dart:convert';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
class Hero {
String name;

View File

@ -1,6 +1,6 @@
// #docregion
// #docregion lc-imports
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'logger_service.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'logger_service.dart';
import 'peek_a_boo_component.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'logger_service.dart';
import 'spy_directive.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'logger_service.dart';

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives:

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES'

View File

@ -5,7 +5,7 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
transformers:
- angular2:

View File

@ -1,6 +1,6 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/bootstrap.dart';
import 'package:angular2/core.dart';
@Component(selector: 'my-app', template: '<h1>My First Angular 2 App</h1>')
class AppComponent {}

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
entry_points: web/main.dart

View File

@ -1,6 +1,6 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/bootstrap.dart';
import 'package:angular2/core.dart';
@Component(selector: 'my-app', template: '<h1>My First Angular 2 App</h1>')
class AppComponent {}

View File

@ -1,6 +1,8 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_service.dart';

View File

@ -4,7 +4,7 @@
import 'dart:async';
import 'dart:convert';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #enddocregion v1
// #docregion import-request-options
import 'package:http/browser_client.dart';

View File

@ -1,4 +1,4 @@
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'package:http_in_memory_web_api/http_in_memory_web_api.dart';
import 'package:http/browser_client.dart';
import 'package:server_communication/hero_data.dart';

View File

@ -1,6 +1,8 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'wikipedia_service.dart';
@Component(

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'package:stream_transformers/stream_transformers.dart';
import 'wikipedia_service.dart';

View File

@ -1,6 +1,7 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'package:jsonpadding/jsonpadding.dart';
@Injectable()

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
http: ^0.11.3+3
jsonpadding: ^0.1.0
stream_transformers: ^0.3.0+3

View File

@ -1,7 +1,7 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
int nextId = 1;

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'heavy_loader_component.dart';
import 'unless_directive.dart';

View File

@ -1,7 +1,7 @@
// #docplaster
// #docregion
// #docregion unless-declaration
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #enddocregion unless-declaration
// #docregion unless-declaration

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

View File

@ -2,7 +2,7 @@
import 'dart:convert';
import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_detail_component.dart';

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';

View File

@ -1,7 +1,7 @@
// #docplaster
import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Directive(selector: '[myClick]')
class MyClickDirective {

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_pipes: 'package:angular2/common.dart#COMMON_PIPES'
@ -16,5 +16,3 @@ transformers:
- 'package:angular2/common.dart#FORM_DIRECTIVES'
entry_points: web/main.dart
- dart_to_js_script_rewriter
- $dart2js:
checked: true

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'package:angular2/router.dart';
import 'package:angular2_tour_of_heroes/heroes_component.dart';

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #enddocregion
import 'package:angular2/router.dart'; // for testing only
// #docregion

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion import-router
import 'package:angular2/router.dart';
// #enddocregion import-router

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion import-router
import 'package:angular2/router.dart';
// #enddocregion import-router

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Component(
selector: 'my-dashboard',

View File

@ -1,6 +1,6 @@
// #docplaster
// #docregion imports
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'hero_service.dart';

View File

@ -4,7 +4,7 @@
import 'dart:html';
// #docregion import-oninit
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #enddocregion import-oninit
// #docregion import-route-params
import 'package:angular2/router.dart';

View File

@ -3,7 +3,7 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'hero.dart';
import 'mock_heroes.dart';

View File

@ -2,7 +2,7 @@
// #docregion
import 'dart:async';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'package:angular2/router.dart';
import 'hero.dart';

View File

@ -5,14 +5,12 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0+4
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: package:angular2/common.dart#COMMON_DIRECTIVES
platform_pipes: package:angular2/common.dart#COMMON_PIPES
entry_points: web/main.dart
- dart_to_js_script_rewriter
- $dart2js:
checked: true

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
import 'click_me_component.dart';
import 'click_me_component_2.dart';

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion click-me-component
@Component(

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
@Component(
selector: 'click-me2',

View File

@ -2,7 +2,7 @@
// #docregion
import 'dart:html';
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion key-up-component-1
@Component(

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion little-tour
@Component(

View File

@ -1,5 +1,5 @@
// #docregion
import 'package:angular2/angular2.dart';
import 'package:angular2/core.dart';
// #docregion loop-back-component
@Component(

View File

@ -5,9 +5,9 @@ version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.11
angular2: 2.0.0-beta.12
browser: ^0.10.0
dart_to_js_script_rewriter: ^0.1.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'

View File

@ -43,7 +43,7 @@ figure.image-display
In `main.dart`, importing `app_component.dart` lets us implement part
of the app in a different Dart file. The QuickStart version of `main.dart`
imported `angular2.dart`, but we don't need that import here because
imported `core.dart`, but we don't need that import here because
this version of `main.dart` is so basic: it only bootstraps the app,
and doesn't implement any components or other injectable types.

View File

@ -41,7 +41,7 @@ p.
specify the angular2 and browser packages as dependencies,
as well as the angular2 transformer.
Angular 2 is still changing, so provide an exact version:
<b>2.0.0-beta.11</b>.
<b>2.0.0-beta.12</b>.
+makeExample('quickstart/dart/ex1/pubspec.yaml', null, 'pubspec.yaml')
@ -106,7 +106,7 @@ p.
consist of more components arising in tree-like fashion from this root.
The top lines import two libraries.
*All* Dart files that use Angular APIs import `angular2.dart`.
*All* Dart files that use Angular APIs import `core.dart`.
Only files that call `bootstrap()` import `bootstrap.dart`.
//- ##########################