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

Commit 371fc82

Browse files
committed
docs(quickstart): reboot edition
1 parent 0fa21c4 commit 371fc82

Some content is hidden

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

51 files changed

+657
-649
lines changed

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);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<style>
9+
body {color:#369;font-family: Arial,Helvetica,sans-serif;}
10+
</style>
11+
12+
<!-- Polyfills for older browsers -->
13+
<script src="node_modules/core-js/client/shim.min.js"></script>
14+
15+
<script src="node_modules/zone.js/dist/zone.js"></script>
16+
<script src="node_modules/reflect-metadata/Reflect.js"></script>
17+
<script src="node_modules/systemjs/dist/system.src.js"></script>
18+
19+
<!-- #docregion no-app-module-->
20+
<script> window.noAppModule = true; </script>
21+
<!-- #enddocregion no-app-module-->
22+
23+
<script src="systemjs.config.js"></script>
24+
<script>
25+
System.import('app').catch(function(err){ console.error(err); });
26+
</script>
27+
</head>
28+
29+
<body>
30+
<!-- #docregion my-app-->
31+
<my-app><!-- content managed by Angular --></my-app>
32+
<!-- #enddocregion my-app-->
33+
</body>
34+
35+
</html>
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,27 @@
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 -->
12-
<!-- #docregion polyfills -->
13-
<!-- Polyfill for older browsers -->
11+
<!-- Polyfills for older browsers -->
1412
<script src="node_modules/core-js/client/shim.min.js"></script>
15-
<!-- #enddocregion polyfills -->
1613

1714
<script src="node_modules/zone.js/dist/zone.js"></script>
1815
<script src="node_modules/reflect-metadata/Reflect.js"></script>
1916
<script src="node_modules/systemjs/dist/system.src.js"></script>
20-
<!-- #enddocregion libraries -->
21-
22-
<!-- 2. Configure SystemJS -->
23-
<!-- #docregion systemjs -->
2417
<script src="systemjs.config.js"></script>
2518
<script>
2619
System.import('app').catch(function(err){ console.error(err); });
2720
</script>
28-
<!-- #enddocregion systemjs -->
2921
</head>
3022

31-
<!-- 3. Display the application -->
32-
<!-- #docregion my-app -->
3323
<body>
34-
<my-app>Loading...</my-app>
24+
<my-app><!-- content managed by Angular --></my-app>
3525
</body>
36-
<!-- #enddocregion my-app -->
26+
3727
</html>

public/docs/_examples/quickstart/ts/package.1.json

-41
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"description": "QuickStart",
33
"files": [
4-
"!**/*.d.ts",
5-
"!**/*.js",
6-
"!**/*.[1].*"
4+
"app/app.component.ts",
5+
"index.1.html"
76
],
7+
"main": "index.1.html",
8+
"open": "app/app.component.ts",
89
"tags": ["quickstart"]
9-
}
10+
}

public/docs/_examples/quickstart/ts/systemjs.config.1.js

-43
This file was deleted.

public/docs/_examples/quickstart/ts/tsconfig.1.json

-12
This file was deleted.
+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,6 @@
1+
// #docregion
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3+
import { AppModule } from './app.module';
4+
platformBrowserDynamic().bootstrapModule(AppModule);
5+
6+
/* This file is excluded in plunkers */

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

Whitespace-only changes.

0 commit comments

Comments
 (0)