You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-15
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,7 @@ If you wish to collaborate while the project is still young, check out [our issu
18
18
19
19
## Prerequisites
20
20
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**.
24
22
25
23
## Table of Contents
26
24
@@ -154,13 +152,7 @@ all dependencies into a single file, and make use of tree-shaking techniques.
154
152
ng test
155
153
```
156
154
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`.
164
156
165
157
### Running end-to-end tests
166
158
@@ -214,7 +206,7 @@ You can modify the these scripts in `package.json` to run whatever tool you pref
214
206
215
207
### Support for offline applications
216
208
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.
218
210
219
211
### Commands autocompletion
220
212
@@ -241,19 +233,47 @@ source ~/.bash_profile
241
233
242
234
### CSS Preprocessor integration
243
235
244
-
We support all major CSS preprocessors:
236
+
Angular-CLI supports all major CSS preprocessors:
245
237
- sass (node-sass)
246
238
- less (less)
247
239
- compass (compass-importer + node-sass)
248
240
- stylus (stylus)
249
241
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
251
261
252
-
The `Angular2App`'s options argument has `sassCompiler`, `lessCompiler`, `stylusCompiler` and `compassCompiler` options that are passed directly to their respective CSS preprocessors.
262
+
```
253
263
254
264
### 3rd Party Library Installation
255
265
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.
257
277
258
278
### Updating angular-cli
259
279
@@ -323,6 +343,8 @@ the local `angular-cli` from the project which was fetched remotely from npm.
323
343
Now the `angular-cli` you cloned before is in three places:
324
344
The folder you cloned it into, npm's folder where it stores global packages and the `angular-cli` project you just created.
325
345
346
+
You can also use `ng new foo --link-cli` to automatically link the `angular-cli` package.
347
+
326
348
Please read the official [npm-link documentation](https://www.npmjs.org/doc/cli/npm-link.html)
327
349
and the [npm-link cheatsheet](http://browsenpm.org/help#linkinganynpmpackagelocally) for more information.
0 commit comments