Skip to content

chore: review docs #1407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ If you wish to collaborate while the project is still young, check out [our issu

## Prerequisites

The generated project has dependencies that require
* **Node 4 or greater**.
* **Typings v1 or greater**.
The generated project has dependencies that require **Node 4 or greater**.

## Table of Contents

Expand Down Expand Up @@ -154,13 +152,7 @@ all dependencies into a single file, and make use of tree-shaking techniques.
ng test
```

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`, and turn off building of the app via `--build=false` (useful for running it at the same time as `ng serve`).

**WARNING:** On Windows, `ng test` is hitting a file descriptor limit (see https://github.com/angular/angular-cli/issues/977).
The solution for now is to instead run `ng serve` and `ng test --build=false` in separate console windows.

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`.

### Running end-to-end tests

Expand Down Expand Up @@ -214,7 +206,7 @@ You can modify the these scripts in `package.json` to run whatever tool you pref

### Support for offline applications

The index.html file includes a commented-out code snippet for installing the angular2-service-worker. This support is experimental, please see the angular/mobile-toolkit project and https://mobile.angular.io/ for documentation on how to make use of this functionality.
Angular-CLI includes support for offline applications via the `--mobile` flag on `ng new`. Support is experimental, please see the angular/mobile-toolkit project and https://mobile.angular.io/ for documentation on how to make use of this functionality.

### Commands autocompletion

Expand All @@ -241,19 +233,47 @@ source ~/.bash_profile

### CSS Preprocessor integration

We support all major CSS preprocessors:
Angular-CLI supports all major CSS preprocessors:
- sass (node-sass)
- less (less)
- compass (compass-importer + node-sass)
- stylus (stylus)

To use one just install for example `npm install node-sass` and rename `.css` files in your project to `.scss` or `.sass`. They will be compiled automatically.
To use these prepocessors simply add the file to your component's `styreUrl`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: preprocessors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, I'll try to include it in the next PR.


```
@Component({
moduleId: module.id,
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.scss']
})
export class AppComponent {
title = 'app works!';
}
```

When generating a new project you can also define which extention you want for
style files:

```bash
ng new sassy-project --style=sass

The `Angular2App`'s options argument has `sassCompiler`, `lessCompiler`, `stylusCompiler` and `compassCompiler` options that are passed directly to their respective CSS preprocessors.
```

### 3rd Party Library Installation

The installation of 3rd party libraries are well described at our [Wiki Page](https://github.com/angular/angular-cli/wiki/3rd-party-libs)
Simply install your library via `npm install lib-name` and import it in your code.

If the library does not include typings, you can search and install them using `npm run typings` npm script provided:

```bash
npm install moment
npm run typings -- search moment
npm run typings -- install dt~moment --global
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to talk about @types and npm install @types/foo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not using @types in the webpack branch atm, and I actually tried now again and I can't seem to get it to work with either the build system or the ts-node for e2e tests. Have you had more success?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't as of recent, we can add it to our nice-to-have-lets-get-it-after-the-branch-lands-in-master list

See https://github.com/typings/typings for more information about the `typings` tool.

### Updating angular-cli

Expand Down Expand Up @@ -323,6 +343,8 @@ the local `angular-cli` from the project which was fetched remotely from npm.
Now the `angular-cli` you cloned before is in three places:
The folder you cloned it into, npm's folder where it stores global packages and the `angular-cli` project you just created.

You can also use `ng new foo --link-cli` to automatically link the `angular-cli` package.

Please read the official [npm-link documentation](https://www.npmjs.org/doc/cli/npm-link.html)
and the [npm-link cheatsheet](http://browsenpm.org/help#linkinganynpmpackagelocally) for more information.

Expand Down
3 changes: 2 additions & 1 deletion addon/ng2/blueprints/ng2/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "tslint \"<%= sourceDir %>/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
"e2e": "protractor",
"typings": "typings"
},
"private": true,
"dependencies": {
Expand Down