docs(dart/quickstart): merge 2 examples into 1

closes #1031
This commit is contained in:
Kathy Walrath 2016-03-31 14:56:52 -07:00
parent 082932a210
commit 2e3af5c55a
7 changed files with 10 additions and 43 deletions

View File

@ -1,12 +0,0 @@
# #docregion
name: angular2_getting_started
description: QuickStart
version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: 2.0.0-beta.12
browser: ^0.10.0
transformers:
- angular2:
entry_points: web/main.dart

View File

@ -1,16 +0,0 @@
<!-- #docregion -->
<!DOCTYPE html>
<html>
<head>
<title>Getting Started</title>
<link rel="stylesheet" href="styles.css">
<!-- #docregion loaddart -->
<script async src="main.dart" type="application/dart"></script>
<script async src="packages/browser/dart.js"></script>
<!-- #enddocregion loaddart -->
</head>
<body>
<my-app>Loading...</my-app>
</body>
</html>

View File

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

View File

@ -1,4 +1,6 @@
# #docplaster
# #docregion
# #docregion no-rewriter
name: angular2_getting_started
description: QuickStart
version: 0.0.1
@ -7,8 +9,11 @@ environment:
dependencies:
angular2: 2.0.0-beta.12
browser: ^0.10.0
# #enddocregion no-rewriter
dart_to_js_script_rewriter: ^1.0.1
# #docregion no-rewriter
transformers:
- angular2:
entry_points: web/main.dart
# #enddocregion no-rewriter
- dart_to_js_script_rewriter

View File

@ -43,7 +43,7 @@ p.
Angular 2 is still changing, so provide an exact version:
<b>2.0.0-beta.12</b>.
+makeExample('quickstart/dart/ex1/pubspec.yaml', null, 'pubspec.yaml')
+makeExample('quickstart/dart/pubspec.yaml', 'no-rewriter', 'pubspec.yaml')
p.
In the same directory, create a <code>web</code> directory, and then
@ -71,7 +71,7 @@ p.
p.
Paste the following code into <code>web/main.dart</code>:
+makeExample('quickstart/dart/ex1/web/main.dart', null, 'web/main.dart')
+makeExample('quickstart/dart/web/main.dart', null, 'web/main.dart')
:marked
You've just defined an Angular 2 **component**,
@ -119,7 +119,7 @@ p.
Create a file named <code>web/index.html</code> that contains
the following code:
+makeExample('quickstart/dart/ex1/web/index.html', null, 'web/index.html')
+makeExample('quickstart/dart/web/index.html', null, 'web/index.html')
:marked
The `<my-app>` tag in the `<body>` is
@ -170,7 +170,7 @@ p.
in both the `dependencies` and `transformers` sections.
- var stylePattern = { pnk: /(dart_to_js_script_rewriter.*$)|(- dart_to_js_script_rewriter.*$)/gm, otl: /(dependencies:)|(transformers:)/g };
+makeExample('quickstart/dart/ex2/pubspec.yaml', null, 'pubspec.yaml', stylePattern)
+makeExample('quickstart/dart/pubspec.yaml', null, 'pubspec.yaml', stylePattern)
p.
Then compile your Dart code to JavaScript,
@ -194,7 +194,7 @@ p.
configure the Angular transformer:
- var stylePattern = { otl: /(transformers:)|(- angular2:)|(entry_points.*$)/gm };
+makeExample('quickstart/dart/ex2/pubspec.yaml', null, 'pubspec.yaml', stylePattern)
+makeExample('quickstart/dart/pubspec.yaml', null, 'pubspec.yaml', stylePattern)
p.
The <code>entry_points</code> item