Skip to content

Commit a5a33fa

Browse files
Broccohansl
authored andcommitted
chore(docs): move the new wiki docs to main repo (#3382)
This move will allow other devs to contribute and allow for pull requests and reviews against docs changes.
1 parent 55acb2e commit a5a33fa

18 files changed

+360
-0
lines changed

docs/documentation/build.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ng build
2+
3+
## Overview
4+
`ng build` compiles the application into an output directory
5+
6+
## Options
7+
`--target` (`-t`, `-dev`, `prod`) define the build target
8+
9+
`--environment` (`-e`)
10+
11+
`--output-path` (`-o`) path where output will be placed
12+
13+
`--watch` (`-w`) flag to run builds when files change
14+
15+
`--surpress-sizes` flag to suppress sizes from build output
16+
17+
`--base-href` (`-bh`) base url for the application being built
18+
19+
`--aot` flag whether to build using Ahead of Time compilation

docs/documentation/config.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
`ng get`
2+
`ng set`

docs/documentation/doc.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ng doc
2+
3+
## Overview
4+
`ng doc [search term]` searches documentation on [angular.io](https://angular.io)

docs/documentation/e2e.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ng e2e
2+
3+
## Overview
4+
`ng e2e` executes end-to-end tests

docs/documentation/generate.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ng generate
2+
3+
## Overview
4+
`ng generate [name]` generates the specified blueprint
5+
6+
## Available blueprints:
7+
- [class](class)
8+
- [component](component)
9+
- [directive](directive)
10+
- [enum](enum)
11+
- [interface](interface)
12+
- [module](module)
13+
- [pipe](pipe)
14+
- [service](service)

docs/documentation/generate/class.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ng generate class
2+
3+
## Overview
4+
`ng generate class [name]` generates a class
5+
6+
## Options
7+
`--spec` specifies if a spec file is generated
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# ng generate component
2+
3+
## Overview
4+
`ng generate component [name]` generates a component
5+
6+
## Options
7+
`--flat` flag to indicate if a dir is created
8+
9+
`--inline-template` (`-it`) specifies if the template will be in the ts file
10+
11+
`--inline-style` (`-is`) specifies if the style will be in the ts file
12+
13+
`--prefix` specifies whether to use the prefix
14+
15+
`--spec` specifies if a spec file is generated
16+
17+
`--view-encapsulation` (`-ve`) set the view encapsulation strategy
18+
19+
`--change-detection` (`-cd`) set the change detection strategy
20+
21+
`--skip-import` allows for skipping the module import
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ng generate directive
2+
3+
## Overview
4+
`ng generate directive [name]` generates a directive
5+
6+
## Options
7+
`--flat` flag to indicate if a dir is created
8+
9+
`--prefix` specifies whether to use the prefix
10+
11+
`--spec` specifies if a spec file is generated
12+
13+
`--skip-import` allows for skipping the module import

docs/documentation/generate/enum.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ng generate enum
2+
3+
## Overview
4+
`ng generate enum [name]` generates an enumeration
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ng generate interface
2+
3+
## Overview
4+
`ng generate interface [name] <type>` generates an interface
5+
6+
## Arguments
7+
8+
`type` optional string to specify the type of interface

docs/documentation/generate/module.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ng generate module
2+
3+
## Overview
4+
`ng generate module [name]` generates an NgModule
5+
6+
## Options
7+
`--spec` specifies if a spec file is generated
8+
9+
`--routing` specifies if a routing module file should be generated

docs/documentation/generate/pipe.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ng generate pipe
2+
3+
## Overview
4+
`ng generate pipe [name]` generates a pipe
5+
6+
## Options
7+
`--flat` flag to indicate if a dir is created
8+
9+
`--spec` specifies if a spec file is generated
10+
11+
`--skip-import` allows for skipping the module import
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ng generate service
2+
3+
## Overview
4+
`ng generate service [name]` generates a service
5+
6+
## Options
7+
`--flat` flag to indicate if a dir is created
8+
9+
`--spec` specifies if a spec file is generated

docs/documentation/init.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# ng init
2+
3+
## Overview
4+
`ng init [name]` initializes, or re-initializes, an angular application.
5+
6+
Initialization is done in-place, meaning that the generated application is initialized in the current directory.
7+
8+
## Options
9+
`--dry-run` (`-d`) run through without making any changes
10+
11+
`--skip-npm` (`-sn`) skip installing npm packages
12+
13+
`--skip-git` (`-sg`) skip initializing a git repository
14+
15+
`--directory` (`-dir`) the directory name to create the app in
16+
17+
`--source-dir` (`-sd`) the name of the source directory
18+
19+
`--style` the style file default extension
20+
21+
`--prefix` (`p`) the prefix to use for all component selectors
22+
23+
`--routing` flag to indicate whether to generate a routing module
24+
25+
`--inline-style` (`is`) flag to indicate if the app component should have an inline style
26+
27+
`--inline-template` (`it`) flag to indicate if the app component should have an inline template

docs/documentation/new.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# ng new
2+
3+
## Overview
4+
`ng new [name]` creates a new angular application.
5+
6+
Default applications are created in a directory of the same name, with an initialized Angular application.
7+
8+
## Options
9+
`--dry-run` (`-d`) run through without making any changes
10+
11+
`--skip-npm` (`-sn`) skip installing npm packages
12+
13+
`--skip-git` (`-sg`) skip initializing a git repository
14+
15+
`--directory` (`-dir`) the directory name to create the app in
16+
17+
`--source-dir` (`-sd`) the name of the source directory
18+
19+
`--style` the style file default extension
20+
21+
`--prefix` (`p`) the prefix to use for all component selectors
22+
23+
`--routing` flag to indicate whether to generate a routing module
24+
25+
`--inline-style` (`is`) flag to indicate if the app component should have an inline style
26+
27+
`--inline-template` (`it`) flag to indicate if the app component should have an inline template

docs/documentation/overview.md

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Angular CLI
2+
3+
### Overview
4+
The Angular CLI is a tool to initialize, develop, scaffold and maintain [Angular](https://angular.io) applications
5+
6+
### Getting Started
7+
To install the angular-cli:
8+
```
9+
npm install -g angular-cli
10+
```
11+
12+
Generating and serving an Angular project via a development server
13+
[Create](new) and [run](serve) a new project:
14+
```
15+
ng new my-project
16+
cd new-project
17+
ng serve
18+
```
19+
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
20+
21+
### Build Targets and Environment Files
22+
23+
`ng build` can specify both a build target (`--target=production` or `--target=development`) and an
24+
environment file to be used with that build (`--environment=dev` or `--environment=prod`).
25+
By default, the development build target and environment are used.
26+
27+
The mapping used to determine which environment file is used can be found in `angular-cli.json`:
28+
29+
```json
30+
"environments": {
31+
"source": "environments/environment.ts",
32+
"dev": "environments/environment.ts",
33+
"prod": "environments/environment.prod.ts"
34+
}
35+
```
36+
37+
These options also apply to the serve command. If you do not pass a value for `environment`,
38+
it will default to `dev` for `development` and `prod` for `production`.
39+
40+
### Bundling
41+
42+
All builds make use of bundling, and using the `--prod` flag in `ng build --prod`
43+
or `ng serve --prod` will also make use of uglifying and tree-shaking functionality.
44+
45+
### Running unit tests
46+
47+
```bash
48+
ng test
49+
```
50+
51+
Tests will execute after a build is executed via [Karma](http://karma-runner.github.io/0.13/index.html), and it will automatically watch your files for changes. You can run tests a single time via `--watch=false` or `--single-run`.
52+
53+
### Running end-to-end tests
54+
55+
```bash
56+
ng e2e
57+
```
58+
59+
Before running the tests make sure you are serving the app via `ng serve`.
60+
End-to-end tests are run via [Protractor](https://angular.github.io/protractor/).
61+
62+
### Global styles
63+
64+
The `styles.css` file allows users to add global styles and supports
65+
[CSS imports](https://developer.mozilla.org/en/docs/Web/CSS/@import).
66+
67+
If the project is created with the `--style=sass` option, this will be a `.sass`
68+
file instead, and the same applies to `scss/less/styl`.
69+
70+
You can add more global styles via the `apps[0].styles` property in `angular-cli.json`.
71+
72+
### Global Library Installation
73+
74+
Some javascript libraries need to be added to the global scope, and loaded as if
75+
they were in a script tag. We can do this using the `apps[0].scripts` and
76+
`apps[0].styles` properties of `angular-cli.json`.
77+
78+
As an example, to use [Bootstrap 4](http://v4-alpha.getbootstrap.com/) this is
79+
what you need to do:
80+
81+
First install Bootstrap from `npm`:
82+
83+
```bash
84+
npm install bootstrap@next
85+
```
86+
87+
Then add the needed script files to `apps[0].scripts`:
88+
89+
```json
90+
"scripts": [
91+
"../node_modules/jquery/dist/jquery.js",
92+
"../node_modules/tether/dist/js/tether.js",
93+
"../node_modules/bootstrap/dist/js/bootstrap.js"
94+
],
95+
```
96+
97+
Finally add the Bootstrap CSS to the `apps[0].styles` array:
98+
```json
99+
"styles": [
100+
"../node_modules/bootstrap/dist/css/bootstrap.css",
101+
"styles.css"
102+
],
103+
```
104+
105+
Restart `ng serve` if you're running it, and Bootstrap 4 should be working on
106+
your app.
107+
108+
### Additional Commands
109+
* [ng new](new)
110+
* [ng init](init)
111+
* [ng serve](serve)
112+
* [ng generate](generate)
113+
* [ng test](test)
114+
* [ng e2e](e2e)
115+
* [ng build](build)
116+
* [ng get/ng set](config)
117+
* [ng docs](docs)
118+
119+
### How to Guides
120+
* Setup AngularFire _(coming soon)_
121+
* Include bootstrap (CSS) _(coming soon)_
122+
* Include Font Awesome _(coming soon)_
123+
* Setup of global styles _(coming soon)_
124+
* Setup bootstrap with SASS _(coming soon)_
125+
* Setup Angular Material 2 _(coming soon)_

docs/documentation/serve.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ng serve
2+
3+
## Overview
4+
`ng serve` builds the application and starts a web server
5+
6+
## Options
7+
`--port` (`-p`) port to serve the application on
8+
9+
`--host` (`-H`)
10+
11+
`--proxy-config` (`-pc`)
12+
13+
`--watcher` (`-w`) provide a new watcher
14+
15+
`--live-reload` (`-lr`) flag to turn off live reloading
16+
17+
`--live-reload-host` (`-lrh`) specify the host for live reloading
18+
19+
`--live-reload-base-url` (`-lrbu`) specify the base URL for live reloading
20+
21+
`--live-reload-port` (`-lrp`) port for live reloading
22+
23+
`--live-reload-live-css` flag to live reload CSS
24+
25+
`--target` (`-t`, `-dev`, `-prod`) target environment
26+
27+
`--environment` (`-e`) build environment
28+
29+
`--ssl` flag to turn on SSL
30+
31+
`--ssl-key` path to the SSL key
32+
33+
`--ssl-cert` path to the SSL cert
34+
35+
`--aot` flag to turn on Ahead of Time compilation
36+
37+
`--open` (`-o`) opens the app in the default browser

docs/documentation/test.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ng test
2+
3+
## Overview
4+
`ng test` compiles the application into an output directory
5+
6+
## Options
7+
`--watch` (`-w`) flag to run builds when files change
8+
9+
`--browsers` override which browsers tests are run against
10+
11+
`--colors` enable or disable colors in the output (reporters and logs)
12+
13+
`--log-level` level of logging
14+
15+
`--port` port where the web server will be listening
16+
17+
`--reporters` list of reporters to use
18+
19+
`--build` flag to build prior to running tests

0 commit comments

Comments
 (0)