parent
082932a210
commit
2e3af5c55a
|
@ -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
|
|
|
@ -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>
|
|
|
@ -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);
|
|
||||||
}
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
# #docplaster
|
||||||
# #docregion
|
# #docregion
|
||||||
|
# #docregion no-rewriter
|
||||||
name: angular2_getting_started
|
name: angular2_getting_started
|
||||||
description: QuickStart
|
description: QuickStart
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
|
@ -7,8 +9,11 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
angular2: 2.0.0-beta.12
|
angular2: 2.0.0-beta.12
|
||||||
browser: ^0.10.0
|
browser: ^0.10.0
|
||||||
|
# #enddocregion no-rewriter
|
||||||
dart_to_js_script_rewriter: ^1.0.1
|
dart_to_js_script_rewriter: ^1.0.1
|
||||||
|
# #docregion no-rewriter
|
||||||
transformers:
|
transformers:
|
||||||
- angular2:
|
- angular2:
|
||||||
entry_points: web/main.dart
|
entry_points: web/main.dart
|
||||||
|
# #enddocregion no-rewriter
|
||||||
- dart_to_js_script_rewriter
|
- dart_to_js_script_rewriter
|
|
@ -43,7 +43,7 @@ p.
|
||||||
Angular 2 is still changing, so provide an exact version:
|
Angular 2 is still changing, so provide an exact version:
|
||||||
<b>2.0.0-beta.12</b>.
|
<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.
|
p.
|
||||||
In the same directory, create a <code>web</code> directory, and then
|
In the same directory, create a <code>web</code> directory, and then
|
||||||
|
@ -71,7 +71,7 @@ p.
|
||||||
p.
|
p.
|
||||||
Paste the following code into <code>web/main.dart</code>:
|
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
|
:marked
|
||||||
You've just defined an Angular 2 **component**,
|
You've just defined an Angular 2 **component**,
|
||||||
|
@ -119,7 +119,7 @@ p.
|
||||||
Create a file named <code>web/index.html</code> that contains
|
Create a file named <code>web/index.html</code> that contains
|
||||||
the following code:
|
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
|
:marked
|
||||||
The `<my-app>` tag in the `<body>` is
|
The `<my-app>` tag in the `<body>` is
|
||||||
|
@ -170,7 +170,7 @@ p.
|
||||||
in both the `dependencies` and `transformers` sections.
|
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 };
|
- 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.
|
p.
|
||||||
Then compile your Dart code to JavaScript,
|
Then compile your Dart code to JavaScript,
|
||||||
|
@ -194,7 +194,7 @@ p.
|
||||||
configure the Angular transformer:
|
configure the Angular transformer:
|
||||||
|
|
||||||
- var stylePattern = { otl: /(transformers:)|(- angular2:)|(entry_points.*$)/gm };
|
- 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.
|
p.
|
||||||
The <code>entry_points</code> item
|
The <code>entry_points</code> item
|
||||||
|
|
Loading…
Reference in New Issue