parent
e258e0f346
commit
a7826ee44c
|
@ -1,9 +1,8 @@
|
|||
// #docregion
|
||||
library developer_guide_intro.backend_service;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:developer_guide_intro/logger_service.dart';
|
||||
import 'package:developer_guide_intro/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
import 'logger_service.dart';
|
||||
|
||||
@Injectable()
|
||||
class BackendService {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// #docregion
|
||||
library developer_guide_intro.hero;
|
||||
|
||||
class Hero {
|
||||
static int _nextId = 1;
|
||||
int id;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// #docregion
|
||||
library developer_guide_intro.hero_detail_component;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:developer_guide_intro/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
|
||||
@Component(selector: 'hero-detail', templateUrl: 'hero_detail_component.html')
|
||||
class HeroDetailComponent {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
// #docplaster
|
||||
library developer_guide_intro.hero_list_component;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:developer_guide_intro/hero.dart';
|
||||
import 'package:developer_guide_intro/hero_detail_component.dart';
|
||||
import 'package:developer_guide_intro/hero_service.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
import 'hero_detail_component.dart';
|
||||
import 'hero_service.dart';
|
||||
|
||||
// #docregion metadata
|
||||
// #docregion providers
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
library developer_guide_intro.hero_service;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:developer_guide_intro/hero.dart';
|
||||
import 'package:developer_guide_intro/backend_service.dart';
|
||||
import 'package:developer_guide_intro/logger_service.dart';
|
||||
|
||||
import 'backend_service.dart';
|
||||
import 'hero.dart';
|
||||
import 'logger_service.dart';
|
||||
|
||||
// #docregion class
|
||||
@Injectable()
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// #docregion
|
||||
library developer_guide_intro.logger_service;
|
||||
|
||||
import 'dart:html';
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
# #docregion
|
||||
name: developer_guide_intro
|
||||
description: Developer Guide Intro
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
- angular2:
|
||||
platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES'
|
||||
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'
|
||||
entry_points: web/main.dart
|
||||
- dart_to_js_script_rewriter
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// #docregion
|
||||
import 'package:angular2/bootstrap.dart';
|
||||
import 'package:developer_guide_intro/backend_service.dart';
|
||||
import 'package:developer_guide_intro/hero_list_component.dart';
|
||||
import 'package:developer_guide_intro/hero_service.dart';
|
||||
import 'package:developer_guide_intro/logger_service.dart';
|
||||
import 'package:developer_guide_intro/hero_list_component.dart';
|
||||
|
||||
main() {
|
||||
// #docregion bootstrap
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
// #docregion
|
||||
library attribute_directives.app_component;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:attribute_directives/highlight_directive.dart';
|
||||
|
||||
import 'highlight_directive.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'my-app',
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
// #docplaster
|
||||
// #docregion full
|
||||
library attribute_directives.highlight_directive;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
@Directive(selector: '[my-highlight]', host: const {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// #docregion
|
||||
library attribute_directives.highlight_directive;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
@Directive(selector: '[my-highlight]',
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
# #docregion
|
||||
name: attribute_directives
|
||||
description: Attribute Directives
|
||||
description: Attribute directives example
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
- angular2:
|
||||
platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES'
|
||||
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'
|
||||
entry_points: web/main.dart
|
||||
- dart_to_js_script_rewriter
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
<script defer src="packages/browser/dart.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<my-app>loading...</my-app>
|
||||
<my-app>Loading...</my-app>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// #docregion all
|
||||
library hero_form.hero;
|
||||
|
||||
class Hero {
|
||||
int number;
|
||||
String name;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
// #docregion no-todo
|
||||
library hero_form.hero_form_component;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:hero_form/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
|
||||
const List<String> _powers = const [
|
||||
'Really Smart',
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// #docregion
|
||||
library hero_form.hero_form_component;
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
@Component(selector: 'hero-form', template: 'Hero form will go here')
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
name: hero_form
|
||||
description: Form example
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
- angular2:
|
||||
platform_directives:
|
||||
- 'package:angular2/common.dart#CORE_DIRECTIVES'
|
||||
- 'package:angular2/common.dart#FORM_DIRECTIVES'
|
||||
entry_points: web/main.dart
|
||||
|
||||
- dart_to_js_script_rewriter
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:hierarchical_di/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'hero-card',
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:hierarchical_di/restore_service.dart';
|
||||
import 'package:hierarchical_di/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
import 'restore_service.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'hero-editor',
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:hierarchical_di/hero.dart';
|
||||
import 'package:hierarchical_di/heroes_service.dart';
|
||||
import 'package:hierarchical_di/hero_editor_component.dart';
|
||||
import 'package:hierarchical_di/hero_card_component.dart';
|
||||
import 'package:hierarchical_di/edit_item.dart';
|
||||
|
||||
import 'edit_item.dart';
|
||||
import 'hero.dart';
|
||||
import 'hero_card_component.dart';
|
||||
import 'hero_editor_component.dart';
|
||||
import 'heroes_service.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'heroes-list',
|
||||
|
@ -41,13 +42,13 @@ class HeroesListComponent {
|
|||
.toList();
|
||||
}
|
||||
|
||||
onCanceled(EditItem<Hero> editItem) {
|
||||
editItem.editing = false;
|
||||
}
|
||||
|
||||
onSaved(EditItem<Hero> editItem, Hero updatedHero) {
|
||||
editItem.item = updatedHero;
|
||||
editItem.editing = false;
|
||||
}
|
||||
|
||||
onCanceled(EditItem<Hero> editItem) {
|
||||
editItem.editing = false;
|
||||
}
|
||||
}
|
||||
// #enddocregion
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:hierarchical_di/hero.dart';
|
||||
|
||||
import 'hero.dart';
|
||||
|
||||
@Injectable()
|
||||
class HeroesService {
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
# #docregion
|
||||
name: 'hierarchical_di'
|
||||
description: Hierarchical dependency injection example
|
||||
version: 0.0.1
|
||||
description: hierarchical dependency injection example
|
||||
|
||||
environment:
|
||||
sdk: '>=1.0.0 <2.0.0'
|
||||
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: '2.0.0-beta.1'
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: '^0.1.0'
|
||||
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
- angular2:
|
||||
platform_directives:
|
||||
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
|
||||
platform_directives: 'package:angular2/common.dart#COMMON_DIRECTIVES'
|
||||
entry_points: web/main.dart
|
||||
- dart_to_js_script_rewriter
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// #docregion
|
||||
import 'package:angular2/bootstrap.dart';
|
||||
import 'package:hierarchical_di/heroes_service.dart';
|
||||
import 'package:hierarchical_di/heroes_list_component.dart';
|
||||
import 'package:hierarchical_di/heroes_service.dart';
|
||||
|
||||
void main() {
|
||||
bootstrap(HeroesListComponent, [HeroesService]);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'logger_service.dart';
|
||||
|
||||
import 'child_component.dart';
|
||||
import 'logger_service.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'after-content',
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
import 'child_component.dart';
|
||||
import 'logger_service.dart';
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'peek_a_boo_parent_component.dart';
|
||||
import 'on_changes_component.dart';
|
||||
import 'after_view_component.dart';
|
||||
|
||||
import 'after_content_parent.dart';
|
||||
import 'spy_component.dart';
|
||||
import 'after_view_component.dart';
|
||||
import 'counter_component.dart';
|
||||
import 'on_changes_component.dart';
|
||||
import 'peek_a_boo_parent_component.dart';
|
||||
import 'spy_component.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'my-app',
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'spy_directive.dart';
|
||||
|
||||
import 'logger_service.dart';
|
||||
import 'spy_directive.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'my-counter',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:angular2/angular2.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
@Injectable()
|
||||
class LoggerService {
|
||||
List<String> logs = [];
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
class Hero {
|
||||
String name;
|
||||
Hero(this.name);
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
// #docregion lc-imports
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:lifecycle_hooks/logger_service.dart';
|
||||
|
||||
import 'logger_service.dart';
|
||||
|
||||
int nextId = 1;
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'package:lifecycle_hooks/logger_service.dart';
|
||||
import 'package:lifecycle_hooks/peek_a_boo_component.dart';
|
||||
|
||||
import 'logger_service.dart';
|
||||
import 'peek_a_boo_component.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'peek-a-boo-parent',
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
import 'logger_service.dart';
|
||||
import 'spy_directive.dart';
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
import 'logger_service.dart';
|
||||
|
||||
int nextId = 1;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# #docregion
|
||||
name: lifecycle_hooks
|
||||
description: Lifecycle Hooks
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.1
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# #docregion
|
||||
name: angular2_getting_started
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
transformers:
|
||||
- angular2:
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# #docregion
|
||||
name: angular2_getting_started
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:angular2/angular2.dart';
|
||||
|
||||
int nextId = 1;
|
||||
|
||||
@Component(
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// #docplaster
|
||||
// #docregion
|
||||
import 'package:angular2/angular2.dart';
|
||||
import 'unless_directive.dart';
|
||||
|
||||
import 'heavy_loader_component.dart';
|
||||
import 'unless_directive.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'structural-directives',
|
||||
|
@ -18,4 +19,3 @@ class StructuralDirectivesComponent {
|
|||
|
||||
get hero => heroes[0];
|
||||
}
|
||||
//#enddocregion
|
||||
|
|
|
@ -106,4 +106,3 @@
|
|||
<div>{{ hero }}</div>
|
||||
</template>
|
||||
<!-- #enddocregion ngFor-template -->
|
||||
<!-- #enddocregion -->
|
||||
|
|
|
@ -29,4 +29,3 @@ class UnlessDirective {
|
|||
// #docregion unless-declaration
|
||||
}
|
||||
// #enddocregion unless-declaration
|
||||
// #enddocregion
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# #docregion
|
||||
name: structural_directives
|
||||
description: Structural directives example
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.1
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
|
|
|
@ -3,9 +3,9 @@ import 'package:angular2/angular2.dart';
|
|||
|
||||
import 'click_me_component.dart';
|
||||
import 'click_me_component_2.dart';
|
||||
import 'loop_back_component.dart';
|
||||
import 'keyup_components.dart';
|
||||
import 'little_tour_component.dart';
|
||||
import 'loop_back_component.dart';
|
||||
|
||||
@Component(
|
||||
selector: 'my-app',
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
# #docregion
|
||||
name: user_input
|
||||
description: User Input
|
||||
description: User input example
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=1.13.0 <2.0.0'
|
||||
dependencies:
|
||||
angular2: 2.0.0-beta.0
|
||||
angular2: 2.0.0-beta.2
|
||||
browser: ^0.10.0
|
||||
dart_to_js_script_rewriter: ^0.1.0
|
||||
transformers:
|
||||
- angular2:
|
||||
platform_directives: 'package:angular2/common.dart#CORE_DIRECTIVES'
|
||||
entry_points: web/main.dart
|
||||
- dart_to_js_script_rewriter
|
||||
|
|
|
@ -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.0</b>.
|
||||
<b>2.0.0-beta.2</b>.
|
||||
|
||||
+makeExample('quickstart/dart/ex1/pubspec.yaml', null, 'pubspec.yaml')
|
||||
|
||||
|
|
Loading…
Reference in New Issue