diff --git a/public/_includes/_next-item.jade b/public/_includes/_next-item.jade
index 55ab4b448f..df379265ae 100644
--- a/public/_includes/_next-item.jade
+++ b/public/_includes/_next-item.jade
@@ -1,5 +1,7 @@
- var currentPage = false
- var nextPage = false
+- var hideNextPage = false;
+
- var data = public.docs[current.path[1]][current.path[2]][current.path[3]]._data
for page, slug in data
@@ -7,13 +9,16 @@ for page, slug in data
// CHECK IF CURRENT PAGE IS SET, THEN SET NEXT PAGE
if currentPage
if !nextPage && page.nextable && !page.hide
- .l-sub-section
- h3 Next Step
- a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title}
+ if !hideNextPage
+ .l-sub-section
+ h3 Next Step
+ a(href="/docs/#{current.path[1]}/#{current.path[2]}/#{current.path[3]}/#{slug}.html") #{page.title}
//NEXT PAGE HAS NOW BEEN SET
- var nextPage = true
+ - hideNextPage = page.hideNextPage
+
// SET CURRENT PAGE FLAG WHEN YOU PASS IT
if current.path[4] == slug
- var currentPage = true
diff --git a/public/docs/_examples/_boilerplate/package.json b/public/docs/_examples/_boilerplate/package.json
index 320fa8f6b2..52ab8e1a67 100644
--- a/public/docs/_examples/_boilerplate/package.json
+++ b/public/docs/_examples/_boilerplate/package.json
@@ -1,6 +1,7 @@
{
"name": "angular-examples",
"version": "1.0.0",
+ "private": true,
"description": "Example package.json, only contains needed scripts for examples. See _examples/package.json for master package.json.",
"scripts": {
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
diff --git a/public/docs/_examples/cb-aot-compiler/e2e-spec.ts b/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
index b03a771faf..ab91490604 100644
--- a/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
+++ b/public/docs/_examples/cb-aot-compiler/e2e-spec.ts
@@ -1,4 +1,4 @@
-'use strict'; // necessary for es6 output in node
+'use strict'; // necessary for es6 output in node
import { browser, element, by } from 'protractor';
@@ -11,7 +11,7 @@ describe('AOT Compilation', function () {
it('should load page and click button', function (done) {
let headingSelector = element.all(by.css('h1')).get(0);
- expect(headingSelector.getText()).toEqual('My First Angular App');
+ expect(headingSelector.getText()).toEqual('Hello Angular');
expect(element.all(by.xpath('//div[text()="Magneta"]')).get(0).isPresent()).toBe(true);
expect(element.all(by.xpath('//div[text()="Bombasto"]')).get(0).isPresent()).toBe(true);
diff --git a/public/docs/_examples/cb-aot-compiler/ts/app/app.component.html b/public/docs/_examples/cb-aot-compiler/ts/app/app.component.html
index 4d7dd8c63f..1d3a8de932 100644
--- a/public/docs/_examples/cb-aot-compiler/ts/app/app.component.html
+++ b/public/docs/_examples/cb-aot-compiler/ts/app/app.component.html
@@ -1,6 +1,6 @@
-
My First Angular App
+
Hello Angular
List of Heroes
{{hero}}
diff --git a/public/docs/_examples/package.json b/public/docs/_examples/package.json
index 38f75c300f..f6837721ef 100644
--- a/public/docs/_examples/package.json
+++ b/public/docs/_examples/package.json
@@ -1,6 +1,7 @@
{
"name": "angular-examples-master",
"version": "1.0.0",
+ "private": true,
"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.",
"scripts": {
"protractor": "protractor",
diff --git a/public/docs/_examples/quickstart/dart/lib/app_component.dart b/public/docs/_examples/quickstart/dart/lib/app_component.dart
index c8d3e6f143..b99162c2aa 100644
--- a/public/docs/_examples/quickstart/dart/lib/app_component.dart
+++ b/public/docs/_examples/quickstart/dart/lib/app_component.dart
@@ -5,7 +5,7 @@ import 'package:angular2/core.dart';
// #docregion metadata
@Component(
selector: 'my-app',
- template: '
Hello Angular!
')
+ template: '
Hello Angular
')
// #enddocregion metadata
// #docregion class
class AppComponent {}
diff --git a/public/docs/_examples/quickstart/e2e-spec.ts b/public/docs/_examples/quickstart/e2e-spec.ts
index 0acc433926..73921707ee 100644
--- a/public/docs/_examples/quickstart/e2e-spec.ts
+++ b/public/docs/_examples/quickstart/e2e-spec.ts
@@ -4,7 +4,7 @@ import { browser, element, by } from 'protractor';
describe('QuickStart E2E Tests', function () {
- let expectedMsg = 'Hello Angular!';
+ let expectedMsg = 'Hello Angular';
beforeEach(function () {
browser.get('');
diff --git a/public/docs/_examples/quickstart/js/app/app.component.js b/public/docs/_examples/quickstart/js/app/app.component.js
index c770e8d1fb..26ba116efe 100644
--- a/public/docs/_examples/quickstart/js/app/app.component.js
+++ b/public/docs/_examples/quickstart/js/app/app.component.js
@@ -10,7 +10,7 @@
ng.core.Component({
// #enddocregion ng-namespace-funcs
selector: 'my-app',
- template: '
should say something about "Angular"');
+ });
+});
diff --git a/public/docs/_examples/setup/ts/app/app.component.ts b/public/docs/_examples/setup/ts/app/app.component.ts
new file mode 100644
index 0000000000..1ef28fc5c4
--- /dev/null
+++ b/public/docs/_examples/setup/ts/app/app.component.ts
@@ -0,0 +1,8 @@
+// #docregion
+import { Component } from '@angular/core';
+
+@Component({
+ selector: 'my-app',
+ template: `
Hello {{name}}
`
+})
+export class AppComponent { name = 'Angular'; }
diff --git a/public/docs/_examples/quickstart/ts/app/app.module.1.ts b/public/docs/_examples/setup/ts/app/app.module.ts
similarity index 51%
rename from public/docs/_examples/quickstart/ts/app/app.module.1.ts
rename to public/docs/_examples/setup/ts/app/app.module.ts
index cd9673617d..50a0e6eb47 100644
--- a/public/docs/_examples/quickstart/ts/app/app.module.1.ts
+++ b/public/docs/_examples/setup/ts/app/app.module.ts
@@ -1,8 +1,11 @@
// #docregion
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
+import { AppComponent } from './app.component';
@NgModule({
- imports: [ BrowserModule ]
+ imports: [ BrowserModule ],
+ declarations: [ AppComponent ],
+ bootstrap: [ AppComponent ]
})
export class AppModule { }
diff --git a/public/docs/_examples/setup/ts/app/main.ts b/public/docs/_examples/setup/ts/app/main.ts
new file mode 100644
index 0000000000..d3e7fa7a2f
--- /dev/null
+++ b/public/docs/_examples/setup/ts/app/main.ts
@@ -0,0 +1,5 @@
+// #docregion
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { AppModule } from './app.module';
+
+platformBrowserDynamic().bootstrapModule(AppModule);
diff --git a/public/docs/_examples/setup/ts/example-config.json b/public/docs/_examples/setup/ts/example-config.json
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/public/docs/_examples/setup/ts/index.html b/public/docs/_examples/setup/ts/index.html
new file mode 100644
index 0000000000..99514d58f2
--- /dev/null
+++ b/public/docs/_examples/setup/ts/index.html
@@ -0,0 +1,31 @@
+
+
+
+
+ Hello Angular
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/docs/_examples/setup/ts/plnkr.json b/public/docs/_examples/setup/ts/plnkr.json
new file mode 100644
index 0000000000..0cbf32e17b
--- /dev/null
+++ b/public/docs/_examples/setup/ts/plnkr.json
@@ -0,0 +1,11 @@
+{
+ "description": "QuickStart Setup",
+ "files": [
+ "app/app.component.ts",
+ "app/app.module.ts",
+ "app/main.ts",
+ "index.html"
+ ],
+ "open": "app/app.component.ts",
+ "tags": ["quickstart setup"]
+}
diff --git a/public/docs/js/latest/quickstart.jade b/public/docs/js/latest/quickstart.jade
index a439063f05..600b9f6b94 100644
--- a/public/docs/js/latest/quickstart.jade
+++ b/public/docs/js/latest/quickstart.jade
@@ -208,7 +208,7 @@ code-example(format="").
:marked
The `template` property holds the component's companion template.
A template is a form of HTML that tells Angular how to render a view.
- Our template is a single line of HTML announcing "Hello Angular!".
+ Our template is a single line of HTML announcing "Hello Angular".
Now we need something to tell Angular to load this component.
diff --git a/public/docs/ts/latest/_data.json b/public/docs/ts/latest/_data.json
index 71d3e2cded..79251b6ade 100644
--- a/public/docs/ts/latest/_data.json
+++ b/public/docs/ts/latest/_data.json
@@ -19,8 +19,8 @@
"icon": "query-builder",
"title": "Quickstart",
"subtitle": "TypeScript",
- "description": "Get up and running with Angular",
- "banner": "This QuickStart guide demonstrates how to build and run a simple Angular application."
+ "description": "Discover Angular",
+ "banner": "Discover Angular in a live-coding environment."
},
"tutorial": {
diff --git a/public/docs/ts/latest/cli-quickstart.jade b/public/docs/ts/latest/cli-quickstart.jade
index 13d492b44e..90f33e179d 100644
--- a/public/docs/ts/latest/cli-quickstart.jade
+++ b/public/docs/ts/latest/cli-quickstart.jade
@@ -199,7 +199,7 @@ h3#component-decorator @Component decorator
+makeExample('src/app/cli-quickstart.component.html', null, 'src/app/cli-quickstart.component.html')(format='.')
:marked
The `{{title}}` is an _interpolation_ binding that causes Angular to display the component's
- `title` property. After out edit, Angular displays "Hello Angular!".
+ `title` property. After out edit, Angular displays "Hello Angular".
We'll learn more about data binding as we read through the documentation.
The **styleUrls** array specifies the location(s) of the component's private CSS style file(s).
diff --git a/public/docs/ts/latest/cookbook/_data.json b/public/docs/ts/latest/cookbook/_data.json
index 78b159e40c..5134b294cd 100644
--- a/public/docs/ts/latest/cookbook/_data.json
+++ b/public/docs/ts/latest/cookbook/_data.json
@@ -2,7 +2,7 @@
"index": {
"title": "Cookbook",
"navTitle": "Overview",
- "description": "A collection of recipes for common Angular application scenarios"
+ "intro": "A collection of recipes for common Angular application scenarios"
},
"aot-compiler": {
diff --git a/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade b/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade
index ebca6c41ce..7105fa190b 100644
--- a/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade
+++ b/public/docs/ts/latest/cookbook/a1-a2-quick-reference.jade
@@ -137,7 +137,7 @@ table(width="100%")
in `main.ts`
and the application's root component (`AppComponent`) in `app.module.ts`.
- For more information see [Quick Start](../quickstart.html).
+ For more information see the [Setup](../guide/setup.html) page.
tr(style=top)
td
:marked
diff --git a/public/docs/ts/latest/cookbook/aot-compiler.jade b/public/docs/ts/latest/cookbook/aot-compiler.jade
index e59218f4fc..8bfcb52143 100644
--- a/public/docs/ts/latest/cookbook/aot-compiler.jade
+++ b/public/docs/ts/latest/cookbook/aot-compiler.jade
@@ -91,8 +91,7 @@ a#compile
## Compile with AoT
### Prepare for offline compilation
-
- Take the QuickStart as a starting point.
+ Take the Setup as a starting point.
A few minor changes to the lone `app.component` lead to these two class and html files:
+makeTabs(
diff --git a/public/docs/ts/latest/glossary.jade b/public/docs/ts/latest/glossary.jade
index b75ccaf207..cc862cae81 100644
--- a/public/docs/ts/latest/glossary.jade
+++ b/public/docs/ts/latest/glossary.jade
@@ -103,10 +103,6 @@ block includes
:marked
The Angular [scoped packages](#scoped-package) each have a barrel named `index`.
- That's why we can write this:
-
- +makeExcerpt('quickstart/ts/app/app.component.ts', 'import', '')
-
.alert.is-important
:marked
Note that you can often achieve this using [Angular modules](#angular-module) instead.
@@ -127,7 +123,8 @@ block includes
.l-sub-section
block bootstrap-defn-top
:marked
- You launch an Angular application by "bootstrapping" it using the application root Angular module (`AppModule`). Bootstrapping identifies an application's top level "root" [component](#component), which is the first component that is loaded for the application. For more information, see [QuickStart](!{docsLatest}/quickstart.html).
+ You launch an Angular application by "bootstrapping" it using the application root Angular module (`AppModule`). Bootstrapping identifies an application's top level "root" [component](#component), which is the first component that is loaded for the application.
+ For more information, see the [Setup](!{docsLatest}/guide/setup.html).
:marked
You can bootstrap multiple apps in the same `index.html`, each with its own top level root.
diff --git a/public/docs/ts/latest/guide/_data.json b/public/docs/ts/latest/guide/_data.json
index 87cd58f9e7..b17b4aff45 100644
--- a/public/docs/ts/latest/guide/_data.json
+++ b/public/docs/ts/latest/guide/_data.json
@@ -2,11 +2,29 @@
"index": {
"title": "Documentation Overview",
"navTitle": "Overview",
- "description": "How to read and use this documentation",
+ "intro": "How to read and use this documentation",
"nextable": true,
"basics": true
},
+ "setup": {
+ "title": "Setup for local development",
+ "navTitle": "Setup",
+ "intro": "Install the Angular QuickStart seed for faster, more efficient development on your machine",
+ "nextable": true,
+ "hideNextPage": true,
+ "basics": true
+ },
+
+ "learning-angular": {
+ "title": "Learning Angular",
+ "navTitle": "Learning Angular",
+ "intro": "A suggested path through the documentation for Angular newcomers",
+ "nextable": true,
+ "hideNextPage": true,
+ "basics": true
+ },
+
"architecture": {
"title": "Architecture Overview",
"navTitle": "Architecture",
@@ -15,6 +33,15 @@
"basics": true
},
+
+ "appmodule": {
+ "title": "AppModule: the root module",
+ "navTitle": "The Root Module",
+ "intro": "Tell Angular how to construct and bootstrap the app in the root \"AppModule\".",
+ "nextable": true,
+ "basics": true
+ },
+
"displaying-data": {
"title": "Displaying Data",
"intro": "Property binding helps show app data in the UI.",
@@ -136,6 +163,11 @@
"intro": "Developing for content security in Angular applications"
},
+ "setup-systemjs-anatomy": {
+ "title": "Setup Anatomy",
+ "intro": "Inside the local development environment for SystemJS"
+ },
+
"structural-directives": {
"title": "Structural Directives",
"intro": "Angular has a powerful template engine that lets us easily manipulate the DOM structure of our elements."
diff --git a/public/docs/ts/latest/guide/appmodule.jade b/public/docs/ts/latest/guide/appmodule.jade
new file mode 100644
index 0000000000..5e5eee9834
--- /dev/null
+++ b/public/docs/ts/latest/guide/appmodule.jade
@@ -0,0 +1,138 @@
+include ../_util-fns
+
+:marked
+ An Angular module class describes how the application parts fit together.
+ Every application has at least one Angular module, the _root_ module
+ that you [bootstrap](#main) to launch the application.
+ You can call it anything you want. The conventional name is `AppModule`.
+
+ The [setup](setup.html) instructions produce a new project with the following minimal `AppModule`.
+ You'll evolve this module as your application grows.
+
++makeExample('setup/ts/app/app.module.ts','', 'app/app.module.ts')(format='.')
+
+:marked
+ After the `import` statements, you come to a class adorned with the
+ **`@NgModule`** [_decorator_](glossary.html#decorator '"Decorator" explained').
+
+ The `@NgModule` decorator identifies `AppModule` as an Angular module class (also called an `NgModule` class).
+ `@NgModule` takes a _metadata_ object that tells Angular how to compile and launch the application.
+
+ * **_imports_** — the `BrowserModule` that this and every application needs to run in a browser.
+ * **_declarations_** — the application's lone component, which is also ...
+ * **_bootstrap_** — the _root_ component that Angular creates and inserts into the `index.html` host web page.
+
+ The [Angular Modules (NgModules)](ngmodule.html) guide dives deeply into the details of Angular modules.
+ All you need to know at the moment is a few basics about these three properties.
+
+a#imports
+:marked
+ ### The _imports_ array
+
+ Angular modules are a way to consolidate features that belong together into discrete units.
+ Many features of Angular itself are organized as Angular modules.
+ HTTP services are in the `HttpModule`. The router is in the `RouterModule`.
+ Eventually you may create a feature module.
+
+ Add a module to the `imports` array when the application requires its features.
+
+ _This_ application, like most applications, executes in a browser.
+ Every application that executes in a browser needs the `BrowserModule` from `@angular/platform-browser`.
+ So every such application includes the `BrowserModule` in its _root_ `AppModule`'s `imports` array.
+ Other guide and cookbook pages will tell you when you need to add additional modules to this array.
+
+.alert.is-important
+ :marked
+ **Only `NgModule` classes** go in the `imports` array. Don't put any other kind of class in `imports`.
+
+.l-sub-section
+ :marked
+ Don't confuse the `import` statements at the top of the file with the Angular module's `imports` array.
+ They have different jobs.
+
+ The _JavaScript_ `import` statements give you access to symbols _exported_ by other files
+ so you can reference them within _this_ file.
+ They have nothing to do with Angular and Angular knows nothing about them.
+
+ The _module's_ `imports` array tells Angular about specific Angular modules — classes decorated with `@NgModule` —
+ that the application needs to function properly.
+a#declarations
+:marked
+ ### The _declarations_ array
+
+ You must declare _every_ component in one (and _only one_) `NgModule` class.
+ You tell Angular which components belong to the `AppModule` by listing it in the module's `declarations` array.
+ As you create more components, you'll add them to `declarations`.
+
+ You'll learn to create two other kinds of classes —
+ [directives](attribute-directives.html) and [pipes](pipes.html) —
+ that you must also add to the `declarations` array.
+
+.alert.is-important
+ :marked
+ **Only _declarables_** — _components_, _directives_ and _pipes_ — belong in the `declarations` array.
+ Don't put any other kind of class in `declarations`; _not_ `NgModule` classes, _not_ service classes, _not_ model classes.
+
+a#bootstrap-array
+:marked
+ ### The _bootstrap_ array
+
+ You launch the application by [_bootstrapping_](#main) the root `AppModule`.
+ Among other things, the _bootstrapping_ process creates the component(s) listed in the `bootstrap` array
+ and inserts each one into the browser DOM.
+
+ Each bootstrapped component is the base of its own tree of components.
+ Inserting a bootstrapped component usually triggers a cascade of component creations that fill out that tree.
+
+ While you can put more than one component tree on a host web page, that's not typical.
+ Most applications have only one component tree and they bootstrap a single _root_ component.
+
+ You can call the one _root_ component anything you want but most developers call it `AppComponent`.
+
+ Which brings us to the _bootstrapping_ process itself.
+
+a#main
+l-main-section
+:marked
+ ## Bootstrap in _main.ts_
+
+ There are many ways to bootstrap an application.
+ The variations depend upon how you want to compile the application and where you want to run it.
+
+ In the beginning, you will compile the application dynamically with the _Just-in-Time (JiT)_ compiler
+ and you'll run it in a browser. You can learn about other options later.
+
+ The recommended place to bootstrap a JiT-compiled browser application is in a separate file
+ in the `app` folder named `app/main.ts`
++makeExample('setup/ts/app/main.ts','','app/main.ts')(format='.')
+:marked
+ This code creates a browser platform for dynamic (JiT) compilation and
+ bootstrap's the `AppModule` described above.
+
+ The _bootstrapping_ process sets up the execution environment,
+ digs the _root_ `AppComponent` out of the module's `bootstrap` array,
+ creates an instance of the component and inserts it within the element tag identified by the component's `selector`.
+
+ The `AppComponent` selector — here and in most documentation samples — is `my-app`
+ so Angular looks for a `` tag in the `index.html` like this one ...
++makeExample('setup/ts/index.html','my-app')(format='.')
+:marked
+ ... and displays the `AppComponent` there.
+
+ This file is very stable. Once you've set it up, you may never change it again.
+
+a#quickstart-appmodule
+l-main-section
+:marked
+ ## QuickStart's _AppModule_
+ Every Angular application must have a root `NgModule`, even the [QuickStart](../quickstart.html).
+ You didn't see it but it was there.
+
+ A script in the `index.html` generated a hidden `AppModule` and bootstrapped it for you
+ so you could focus on the `AppComponent` and discover the _essential Angular_ more quickly.
+
+ If you're feeling adventurous, add your own `AppModule` and `main.ts` to the
+ live code in the _QuickStart_ plunker.
+
+ Remove the following `'
+ to: ''
},
// Clear script like this:
//