mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-16 18:43:42 +08:00
docs: improve README files generated by Angular schematics
This commit is contained in:
parent
a68e832aef
commit
29855bf54e
@ -1,24 +1,63 @@
|
||||
# <%= classify(name) %>
|
||||
|
||||
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= angularLatestVersion %>.
|
||||
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version <%= angularLatestVersion %>.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name --project <%= name %>` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project <%= name %>`.
|
||||
> Note: Don't forget to add `--project <%= name %>` or else it will be added to the default project in your `angular.json` file.
|
||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||
|
||||
## Build
|
||||
```bash
|
||||
ng generate component component-name
|
||||
```
|
||||
|
||||
Run `ng build <%= name %>` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||
|
||||
## Publishing
|
||||
```bash
|
||||
ng generate --help
|
||||
```
|
||||
|
||||
After building your library with `ng build <%= name %>`, go to the dist folder `cd dist/<%= dasherize(name) %>` and run `npm publish`.
|
||||
## Building
|
||||
|
||||
To build the library, run:
|
||||
|
||||
```bash
|
||||
ng build <%= name %>
|
||||
```
|
||||
|
||||
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
||||
|
||||
### Publishing the Library
|
||||
|
||||
Once the project is built, you can publish your library by following these steps:
|
||||
|
||||
1. Navigate to the `dist` directory:
|
||||
```bash
|
||||
cd dist/<%= dasherize(name) %>
|
||||
```
|
||||
|
||||
2. Run the `npm publish` command to publish your library to the npm registry:
|
||||
```bash
|
||||
npm publish
|
||||
```
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test <%= name %>` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||
|
||||
## Further help
|
||||
```bash
|
||||
ng test
|
||||
```
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
## Running end-to-end tests
|
||||
|
||||
For end-to-end (e2e) testing, run:
|
||||
|
||||
```bash
|
||||
ng e2e
|
||||
```
|
||||
|
||||
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
|
@ -1,27 +1,59 @@
|
||||
# <%= utils.classify(name) %>
|
||||
|
||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version <%= version %>.
|
||||
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version <%= version %>.
|
||||
|
||||
## Development server
|
||||
|
||||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
||||
To start a local development server, run:
|
||||
|
||||
```bash
|
||||
ng serve
|
||||
```
|
||||
|
||||
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate --help` to see all the available schematics you can generate.
|
||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||
|
||||
## Build
|
||||
```bash
|
||||
ng generate component component-name
|
||||
```
|
||||
|
||||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
||||
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||
|
||||
```bash
|
||||
ng generate --help
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
To build the project run:
|
||||
|
||||
```bash
|
||||
ng build
|
||||
```
|
||||
|
||||
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||
|
||||
```bash
|
||||
ng test
|
||||
```
|
||||
|
||||
## Running end-to-end tests
|
||||
|
||||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
||||
For end-to-end (e2e) testing, run:
|
||||
|
||||
## Further help
|
||||
```bash
|
||||
ng e2e
|
||||
```
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
|
Loading…
x
Reference in New Issue
Block a user