Skip to content

Commit 698ba0c

Browse files
authored
chore: review docs (#1407)
1 parent 4cfc463 commit 698ba0c

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

README.md

+37-15
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ If you wish to collaborate while the project is still young, check out [our issu
1818

1919
## Prerequisites
2020

21-
The generated project has dependencies that require
22-
* **Node 4 or greater**.
23-
* **Typings v1 or greater**.
21+
The generated project has dependencies that require **Node 4 or greater**.
2422

2523
## Table of Contents
2624

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

157-
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.
158-
159-
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`).
160-
161-
**WARNING:** On Windows, `ng test` is hitting a file descriptor limit (see https://github.com/angular/angular-cli/issues/977).
162-
The solution for now is to instead run `ng serve` and `ng test --build=false` in separate console windows.
163-
155+
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`.
164156

165157
### Running end-to-end tests
166158

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

215207
### Support for offline applications
216208

217-
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.
209+
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.
218210

219211
### Commands autocompletion
220212

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

242234
### CSS Preprocessor integration
243235

244-
We support all major CSS preprocessors:
236+
Angular-CLI supports all major CSS preprocessors:
245237
- sass (node-sass)
246238
- less (less)
247239
- compass (compass-importer + node-sass)
248240
- stylus (stylus)
249241

250-
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.
242+
To use these prepocessors simply add the file to your component's `styreUrl`:
243+
244+
```
245+
@Component({
246+
moduleId: module.id,
247+
selector: 'app-root',
248+
templateUrl: 'app.component.html',
249+
styleUrls: ['app.component.scss']
250+
})
251+
export class AppComponent {
252+
title = 'app works!';
253+
}
254+
```
255+
256+
When generating a new project you can also define which extention you want for
257+
style files:
258+
259+
```bash
260+
ng new sassy-project --style=sass
251261

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

254264
### 3rd Party Library Installation
255265

256-
The installation of 3rd party libraries are well described at our [Wiki Page](https://github.com/angular/angular-cli/wiki/3rd-party-libs)
266+
Simply install your library via `npm install lib-name` and import it in your code.
267+
268+
If the library does not include typings, you can search and install them using `npm run typings` npm script provided:
269+
270+
```bash
271+
npm install moment
272+
npm run typings -- search moment
273+
npm run typings -- install dt~moment --global
274+
```
275+
276+
See https://github.com/typings/typings for more information about the `typings` tool.
257277

258278
### Updating angular-cli
259279

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

346+
You can also use `ng new foo --link-cli` to automatically link the `angular-cli` package.
347+
326348
Please read the official [npm-link documentation](https://www.npmjs.org/doc/cli/npm-link.html)
327349
and the [npm-link cheatsheet](http://browsenpm.org/help#linkinganynpmpackagelocally) for more information.
328350

addon/ng2/blueprints/ng2/files/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"lint": "tslint \"<%= sourceDir %>/**/*.ts\"",
1010
"test": "ng test",
1111
"pree2e": "webdriver-manager update",
12-
"e2e": "protractor"
12+
"e2e": "protractor",
13+
"typings": "typings"
1314
},
1415
"private": true,
1516
"dependencies": {

0 commit comments

Comments
 (0)