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

Commit 8ccc33e

Browse files
authored
[WIP] docs(quickstart): QuickStart reboot (#2762)
1 parent bcab064 commit 8ccc33e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+855
-564
lines changed

public/_includes/_next-item.jade

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
- var currentPage = false
22
- var nextPage = false
3+
- var hideNextPage = false;
4+
35
- var data = public.docs[current.path[1]][current.path[2]][current.path[3]]._data
46

57
for page, slug in data
68

79
// CHECK IF CURRENT PAGE IS SET, THEN SET NEXT PAGE
810
if currentPage
911
if !nextPage && page.nextable && !page.hide
10-
.l-sub-section
11-
h3 Next Step
12-
a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title}
12+
if !hideNextPage
13+
.l-sub-section
14+
h3 Next Step
15+
a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title}
1316

1417
//NEXT PAGE HAS NOW BEEN SET
1518
- var nextPage = true
1619

20+
- hideNextPage = page.hideNextPage
21+
1722
// SET CURRENT PAGE FLAG WHEN YOU PASS IT
1823
if current.path[4] == slug
1924
- var currentPage = true

public/docs/_examples/_boilerplate/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "angular-examples",
33
"version": "1.0.0",
4+
"private": true,
45
"description": "Example package.json, only contains needed scripts for examples. See _examples/package.json for master package.json.",
56
"scripts": {
67
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",

public/docs/_examples/cb-aot-compiler/e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict'; // necessary for es6 output in node
1+
'use strict'; // necessary for es6 output in node
22

33
import { browser, element, by } from 'protractor';
44

@@ -11,7 +11,7 @@ describe('AOT Compilation', function () {
1111

1212
it('should load page and click button', function (done) {
1313
let headingSelector = element.all(by.css('h1')).get(0);
14-
expect(headingSelector.getText()).toEqual('My First Angular App');
14+
expect(headingSelector.getText()).toEqual('Hello Angular');
1515

1616
expect(element.all(by.xpath('//div[text()="Magneta"]')).get(0).isPresent()).toBe(true);
1717
expect(element.all(by.xpath('//div[text()="Bombasto"]')).get(0).isPresent()).toBe(true);

public/docs/_examples/cb-aot-compiler/ts/app/app.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- #docregion -->
22
<button (click)="toggleHeading()">Toggle Heading</button>
3-
<h1 *ngIf="showHeading">My First Angular App</h1>
3+
<h1 *ngIf="showHeading">Hello Angular</h1>
44

55
<h3>List of Heroes</h3>
66
<div *ngFor="let hero of heroes">{{hero}}</div>

public/docs/_examples/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "angular-examples-master",
33
"version": "1.0.0",
4+
"private": true,
45
"description": "Master package.json, the superset of all dependencies for all of the _example package.json files. See _boilerplate/package.json for example npm scripts.",
56
"scripts": {
67
"protractor": "protractor",

public/docs/_examples/quickstart/dart/lib/app_component.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import 'package:angular2/core.dart';
55
// #docregion metadata
66
@Component(
77
selector: 'my-app',
8-
template: '<h1>Hello Angular!</h1>')
8+
template: '<h1>Hello Angular</h1>')
99
// #enddocregion metadata
1010
// #docregion class
1111
class AppComponent {}

public/docs/_examples/quickstart/e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { browser, element, by } from 'protractor';
44

55
describe('QuickStart E2E Tests', function () {
66

7-
let expectedMsg = 'Hello Angular!';
7+
let expectedMsg = 'Hello Angular';
88

99
beforeEach(function () {
1010
browser.get('');

public/docs/_examples/quickstart/js/app/app.component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ng.core.Component({
1111
// #enddocregion ng-namespace-funcs
1212
selector: 'my-app',
13-
template: '<h1>Hello Angular!</h1>'
13+
template: '<h1>Hello Angular</h1>'
1414
// #docregion ng-namespace-funcs
1515
})
1616
// #enddocregion component

public/docs/_examples/quickstart/ts/.gitignore

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
// #docregion
2-
// #docregion import
32
import { Component } from '@angular/core';
4-
// #enddocregion import
53

6-
// #docregion metadata
74
@Component({
85
selector: 'my-app',
9-
template: '<h1>Hello Angular!</h1>'
6+
template: `<h1>Hello {{name}}</h1>`
107
})
11-
// #enddocregion metadata
12-
// #docregion class
13-
export class AppComponent { }
14-
// #enddocregion class
8+
export class AppComponent { name = 'Angular'; }
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// #docregion
22
import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
4-
5-
import { AppComponent } from './app.component';
4+
import { AppComponent } from './app.component';
65

76
@NgModule({
87
imports: [ BrowserModule ],
98
declarations: [ AppComponent ],
109
bootstrap: [ AppComponent ]
1110
})
12-
1311
export class AppModule { }
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
// #docregion
2-
// #docregion import
31
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
42

53
import { AppModule } from './app.module';
6-
// #enddocregion import
74

8-
const platform = platformBrowserDynamic();
9-
platform.bootstrapModule(AppModule);
5+
platformBrowserDynamic().bootstrapModule(AppModule);
+13-14
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
<!DOCTYPE html>
2-
<!-- #docregion -->
32
<html>
43
<head>
5-
<title>Angular QuickStart</title>
4+
<title>Hello Angular</title>
65
<meta charset="UTF-8">
76
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link rel="stylesheet" href="styles.css">
7+
<style>
8+
body {color:#369;font-family: Arial,Helvetica,sans-serif;}
9+
</style>
910

10-
<!-- 1. Load libraries -->
11-
<!-- #docregion libraries -->
11+
<!-- Polyfills for older browsers -->
1212
<!-- #docregion polyfills -->
13-
<!-- Polyfill for older browsers -->
1413
<script src="node_modules/core-js/client/shim.min.js"></script>
1514
<!-- #enddocregion polyfills -->
1615

1716
<script src="node_modules/zone.js/dist/zone.js"></script>
1817
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1918
<script src="node_modules/systemjs/dist/system.src.js"></script>
20-
<!-- #enddocregion libraries -->
2119

22-
<!-- 2. Configure SystemJS -->
23-
<!-- #docregion systemjs -->
20+
<!-- #docregion autobootstrap-->
21+
<script> window.autoBootstrap = true; </script>
22+
<!-- #enddocregion autobootstrap-->
23+
2424
<script src="systemjs.config.js"></script>
2525
<script>
2626
System.import('app').catch(function(err){ console.error(err); });
2727
</script>
28-
<!-- #enddocregion systemjs -->
2928
</head>
3029

31-
<!-- 3. Display the application -->
32-
<!-- #docregion my-app -->
3330
<body>
34-
<my-app>Loading...</my-app>
31+
<!-- #docregion my-app-->
32+
<my-app>Loading AppComponent content here ...</my-app>
33+
<!-- #enddocregion my-app-->
3534
</body>
36-
<!-- #enddocregion my-app -->
35+
3736
</html>
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"description": "QuickStart",
33
"files": [
4-
"!**/*.d.ts",
5-
"!**/*.js",
6-
"!**/*.[1].*"
4+
"app/app.component.ts",
5+
"index.html"
76
],
7+
"open": "app/app.component.ts",
88
"tags": ["quickstart"]
9-
}
9+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
'use strict'; // necessary for es6 output in node
2+
3+
import { browser, element, by } from 'protractor';
4+
5+
describe('QuickStart E2E Tests', function () {
6+
7+
let expectedMsg = 'Hello Angular';
8+
9+
beforeEach(function () {
10+
browser.get('');
11+
});
12+
13+
it(`should display: ${expectedMsg}`, function () {
14+
expect(element(by.css('h1')).getText()).toEqual(expectedMsg);
15+
});
16+
17+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* tslint:disable:no-unused-variable */
2+
import { AppComponent } from './app.component';
3+
4+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
5+
import { By } from '@angular/platform-browser';
6+
import { DebugElement } from '@angular/core';
7+
8+
//////// SPECS /////////////
9+
describe('AppComponent', function () {
10+
let de: DebugElement;
11+
let comp: AppComponent;
12+
let fixture: ComponentFixture<AppComponent>;
13+
14+
beforeEach(async(() => {
15+
TestBed.configureTestingModule({
16+
declarations: [ AppComponent ]
17+
})
18+
.compileComponents();
19+
}));
20+
21+
beforeEach(() => {
22+
fixture = TestBed.createComponent(AppComponent);
23+
comp = fixture.componentInstance;
24+
de = fixture.debugElement.query(By.css('h1'));
25+
});
26+
27+
it('should create component', () => expect(comp).toBeDefined() );
28+
29+
it('should have expected <h1> text', () => {
30+
fixture.detectChanges();
31+
const h1 = de.nativeElement;
32+
expect(h1.innerText).toMatch(/angular/i,
33+
'<h1> should say something about "Angular"');
34+
});
35+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// #docregion
2+
import { Component } from '@angular/core';
3+
4+
@Component({
5+
selector: 'my-app',
6+
template: `<h1>Hello {{name}}</h1>`
7+
})
8+
export class AppComponent { name = 'Angular'; }
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// #docregion
22
import { NgModule } from '@angular/core';
33
import { BrowserModule } from '@angular/platform-browser';
4+
import { AppComponent } from './app.component';
45

56
@NgModule({
6-
imports: [ BrowserModule ]
7+
imports: [ BrowserModule ],
8+
declarations: [ AppComponent ],
9+
bootstrap: [ AppComponent ]
710
})
811
export class AppModule { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// #docregion
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
import { AppModule } from './app.module';
4+
5+
platformBrowserDynamic().bootstrapModule(AppModule);

public/docs/_examples/setup/ts/example-config.json

Whitespace-only changes.
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<!-- #docregion -->
3+
<html>
4+
<head>
5+
<title>Hello Angular</title>
6+
<meta charset="UTF-8">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="stylesheet" href="styles.css">
9+
<style>
10+
body {color:#369;font-family: Arial,Helvetica,sans-serif;}
11+
</style>
12+
13+
<!-- Polyfills for older browsers -->
14+
<script src="node_modules/core-js/client/shim.min.js"></script>
15+
16+
<script src="node_modules/zone.js/dist/zone.js"></script>
17+
<script src="node_modules/reflect-metadata/Reflect.js"></script>
18+
<script src="node_modules/systemjs/dist/system.src.js"></script>
19+
<script src="systemjs.config.js"></script>
20+
<script>
21+
System.import('app').catch(function(err){ console.error(err); });
22+
</script>
23+
</head>
24+
25+
<body>
26+
<!-- #docregion my-app-->
27+
<my-app><!-- content managed by Angular --></my-app>
28+
<!-- #enddocregion my-app-->
29+
</body>
30+
31+
</html>
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"description": "QuickStart Setup",
3+
"files": [
4+
"app/app.component.ts",
5+
"app/app.module.ts",
6+
"app/main.ts",
7+
"index.html"
8+
],
9+
"open": "app/app.component.ts",
10+
"tags": ["quickstart setup"]
11+
}

public/docs/js/latest/quickstart.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ code-example(format="").
208208
:marked
209209
The `template` property holds the component's companion template.
210210
A template is a form of HTML that tells Angular how to render a view.
211-
Our template is a single line of HTML announcing "Hello Angular!".
211+
Our template is a single line of HTML announcing "Hello Angular".
212212

213213
Now we need something to tell Angular to load this component.
214214

public/docs/ts/latest/_data.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"icon": "query-builder",
2020
"title": "Quickstart",
2121
"subtitle": "TypeScript",
22-
"description": "Get up and running with Angular",
23-
"banner": "This QuickStart guide demonstrates how to build and run a simple Angular application."
22+
"description": "Discover Angular",
23+
"banner": "Discover Angular in a live-coding environment."
2424
},
2525

2626
"tutorial": {

public/docs/ts/latest/cli-quickstart.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ h3#component-decorator @Component decorator
199199
+makeExample('src/app/cli-quickstart.component.html', null, 'src/app/cli-quickstart.component.html')(format='.')
200200
:marked
201201
The `{{title}}` is an _interpolation_ binding that causes Angular to display the component's
202-
`title` property. After out edit, Angular displays "Hello Angular!".
202+
`title` property. After out edit, Angular displays "Hello Angular".
203203
We'll learn more about data binding as we read through the documentation.
204204

205205
The **styleUrls** array specifies the location(s) of the component's private CSS style file(s).

public/docs/ts/latest/cookbook/_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"index": {
33
"title": "Cookbook",
44
"navTitle": "Overview",
5-
"description": "A collection of recipes for common Angular application scenarios"
5+
"intro": "A collection of recipes for common Angular application scenarios"
66
},
77

88
"aot-compiler": {

public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ table(width="100%")
137137
in `main.ts`
138138
and the application's root component (`AppComponent`) in `app.module.ts`.
139139

140-
For more information see [Quick Start](../quickstart.html).
140+
For more information see the [Setup](../guide/setup.html) page.
141141
tr(style=top)
142142
td
143143
:marked

public/docs/ts/latest/cookbook/aot-compiler.jade

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ a#compile
9191
## Compile with AoT
9292

9393
### Prepare for offline compilation
94-
95-
Take the <a href='/docs/ts/latest/quickstart.html'>QuickStart</a> as a starting point.
94+
Take the <a href='../guide/setup.html'>Setup</a> as a starting point.
9695
A few minor changes to the lone `app.component` lead to these two class and html files:
9796

9897
+makeTabs(

0 commit comments

Comments
 (0)