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
The purpose of the changes is to clean all markdown to match a single pedantic style.
* To ensure all changes in style are properly separated.
* To ensure all styled content aligns to nearest 4-character-tab.
* To ensure all code blocks use the Angular `<code-example>` or `<code-tab>` elements.
* To ensure all markdown exists outside of html tags.
* To ensure all images use the Angular style for `<img>` elements.
* To ensure that all smart punctuation is replaced or removed.
```text
’, ’, “, ”, –, —, …
```
* To ensure all content does not conflict with the following reserved characters.
```text
@, $, *, &, #, |, <, >,
```
* To ensure all content displays using html entities.
The following changes were made to files in the following directory.
```text
aio/content
```
The target files were markdown files.
The list of excluded files:
```text
.browserslistrc, .css, .conf, .editorconfig, .gitignore, .html, .js, .json, .sh, .svg, .ts, .txt, .xlf,
```
PR Close#45325
Copy file name to clipboardExpand all lines: aio/content/cli/index.md
+46-23Lines changed: 46 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,40 +7,47 @@ The Angular CLI is a command-line interface tool that you use to initialize, dev
7
7
Major versions of Angular CLI follow the supported major version of Angular, but minor versions can be released separately.
8
8
9
9
Install the CLI using the `npm` package manager:
10
-
<code-examplelanguage="bash">
11
-
npm install -g @angular/cli
10
+
11
+
<code-exampleformat="shell"language="shell">
12
+
13
+
npm install -g @angular/cli
14
+
12
15
</code-example>
13
16
14
-
For details about changes between versions, and information about updating from previous releases,
15
-
see the Releases tab on GitHub: https://github.com/angular/angular-cli/releases
17
+
For details about changes between versions, and information about updating from previous releases, see the Releases tab on GitHub: https://github.com/angular/angular-cli/releases
16
18
17
19
## Basic workflow
18
20
19
21
Invoke the tool on the command line through the `ng` executable.
20
22
Online help is available on the command line.
21
-
Enter the following to list commands or options for a given command (such as [generate](cli/generate)) with a short description.
23
+
Enter the following to list commands or options for a given command \(such as [generate](cli/generate)\) with a short description.
24
+
25
+
<code-exampleformat="shell"language="shell">
22
26
23
-
<code-examplelanguage="bash">
24
27
ng help
25
28
ng generate --help
29
+
26
30
</code-example>
27
31
28
32
To create, build, and serve a new, basic Angular project on a development server, go to the parent directory of your new workspace use the following commands:
29
33
30
-
<code-examplelanguage="bash">
34
+
<code-exampleformat="shell"language="shell">
35
+
31
36
ng new my-first-project
32
37
cd my-first-project
33
38
ng serve
39
+
34
40
</code-example>
35
41
36
42
In your browser, open http://localhost:4200/ to see the new application run.
37
43
When you use the [ng serve](cli/serve) command to build an application and serve it locally, the server automatically rebuilds the application and reloads the page when you change any of the source files.
38
44
39
45
<divclass="alert is-helpful">
40
46
41
-
When you run `ng new my-first-project` a new folder, named `my-first-project`, will be created in the current working directory. Since you want to be able to create files inside that folder, make sure you have sufficient rights in the current working directory before running the command.
47
+
When you run `ng new my-first-project` a new folder, named `my-first-project`, will be created in the current working directory.
48
+
Since you want to be able to create files inside that folder, make sure you have sufficient rights in the current working directory before running the command.
42
49
43
-
If the current working directory is not the right place for your project, you can change to a more appropriate directory by running `cd <path-to-other-directory>` first.
50
+
If the current working directory is not the right place for your project, you can change to a more appropriate directory by running `cd <path-to-other-directory>` first.
44
51
45
52
</div>
46
53
@@ -58,52 +65,68 @@ You can edit the generated files directly, or add to and modify them using CLI c
58
65
Use the [ng generate](cli/generate) command to add new files for additional components and services, and code for new pipes, directives, and so on.
59
66
Commands such as [add](cli/add) and [generate](cli/generate), which create or operate on applications and libraries, must be executed from within a workspace or project folder.
60
67
61
-
* See more about the [Workspace file structure](guide/file-structure).
68
+
*See more about the [Workspace file structure](guide/file-structure).
62
69
63
70
### Workspace and project configuration
64
71
65
72
A single workspace configuration file, `angular.json`, is created at the top level of the workspace.
66
73
This is where you can set per-project defaults for CLI command options, and specify configurations to use when the CLI builds a project for different targets.
67
74
68
75
The [ng config](cli/config) command lets you set and retrieve configuration values from the command line, or you can edit the `angular.json` file directly.
69
-
Note that option names in the configuration file must use [camelCase](guide/glossary#case-types), while option names supplied to commands must be dash-case.
70
76
71
-
* See more about [Workspace Configuration](guide/workspace-config).
77
+
<divclass="alert is-helpful">
78
+
79
+
**NOTE**: <br />
80
+
Option names in the configuration file must use [camelCase](guide/glossary#case-types), while option names supplied to commands must be dash-case.
81
+
82
+
</div>
83
+
84
+
* See more about [Workspace Configuration](guide/workspace-config).
* Most commands, and some options, have aliases. Aliases are shown in the syntax statement for each command.
92
+
* Most commands, and some options, have aliases.
93
+
Aliases are shown in the syntax statement for each command.
80
94
81
-
* Option names are prefixed with a double dash (--).
82
-
Option aliases are prefixed with a single dash (-).
95
+
*Option names are prefixed with a double dash \(`--`\) characters.
96
+
Option aliases are prefixed with a single dash \(`-`\) character.
83
97
Arguments are not prefixed.
84
98
For example:
85
-
<code-examplelanguage="bash">
86
-
ng build my-app -c production
99
+
100
+
<code-exampleformat="shell"language="shell">
101
+
102
+
ng build my-app -c production
103
+
87
104
</code-example>
88
105
89
-
* Typically, the name of a generated artifact can be given as an argument to the command or specified with the --name option.
106
+
*Typically, the name of a generated artifact can be given as an argument to the command or specified with the `--name` option.
90
107
91
-
* Argument and option names can be given in either
92
-
[camelCase or dash-case](guide/glossary#case-types).
93
-
`--myOptionName` is equivalent to `--my-option-name`.
108
+
* Argument and option names can be given in either [camelCase or dash-case](guide/glossary#case-types).
109
+
`--myOptionName` is equivalent to `--my-option-name`.
94
110
95
111
### Boolean options
96
112
97
113
Boolean options have two forms: `--this-option` sets the flag to `true`, `--no-this-option` sets it to `false`.
98
114
If neither option is supplied, the flag remains in its default state, as listed in the reference documentation.
99
115
100
-
101
116
### Relative paths
102
117
103
118
Options that specify files can be given as absolute paths, or as paths relative to the current working directory, which is generally either the workspace or project root.
104
119
105
120
### Schematics
106
121
107
-
The [ng generate](cli/generate) and [ng add](cli/add) commands take as an argument the artifact or library to be generated or added to the current project.
122
+
The [ng generate](cli/generate) and [ng add](cli/add) commands take as an argument the artifact or library to be generated or added to the current project.
108
123
In addition to any general options, each artifact or library defines its own options in a *schematic*.
109
124
Schematic options are supplied to the command in the same format as immediate command options.
Copy file name to clipboardExpand all lines: aio/content/errors/NG0100.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,27 @@
4
4
@shortDescription Expression has changed after it was checked
5
5
6
6
@description
7
+
7
8
Angular throws an `ExpressionChangedAfterItHasBeenCheckedError` when an expression value has been changed after change detection has completed. Angular only throws this error in development mode.
8
9
9
-
In development mode, Angular performs an additional check after each change detection run, to ensure the bindings haven’t changed. This catches errors where the view is left in an inconsistent state. This can occur, for example, if a method or getter returns a different value each time it is called, or if a child component changes values on its parent. If either of these occur, this is a sign that change detection is not stabilized. Angular throws the error to ensure data is always reflected correctly in the view, which prevents erratic UI behavior or a possible infinite loop.
10
+
In development mode, Angular performs an additional check after each change detection run, to ensure the bindings haven't changed. This catches errors where the view is left in an inconsistent state. This can occur, for example, if a method or getter returns a different value each time it is called, or if a child component changes values on its parent. If either of these occur, this is a sign that change detection is not stabilized. Angular throws the error to ensure data is always reflected correctly in the view, which prevents erratic UI behavior or a possible infinite loop.
10
11
11
-
This error commonly occurs when you’ve added template expressions or begun to implement lifecycle hooks like `ngAfterViewInit` or `ngOnChanges`. It is also common when dealing with loading status and asynchronous operations, or a child component changes its parent bindings.
12
+
This error commonly occurs when you've added template expressions or begun to implement lifecycle hooks like `ngAfterViewInit` or `ngOnChanges`. It is also common when dealing with loading status and asynchronous operations, or a child component changes its parent bindings.
12
13
13
14
@debugging
14
-
The [source maps](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map) generated by the CLI are very useful when debugging. Navigate up the call stack until you find a template expression where the value displayed in the error has changed.
15
+
16
+
The [source maps](https://developer.mozilla.org/docs/Tools/Debugger/How_to/Use_a_source_map) generated by the CLI are very useful when debugging. Navigate up the call stack until you find a template expression where the value displayed in the error has changed.
15
17
16
18
Ensure that there are no changes to the bindings in the template after change detection is run. This often means refactoring to use the correct [component lifecycle hook](guide/lifecycle-hooks) for your use case. If the issue exists within `ngAfterViewInit`, the recommended solution is to use a constructor or `ngOnInit` to set initial values, or use `ngAfterContentInit` for other value bindings.
17
19
18
20
If you are binding to methods in the view, ensure that the invocation does not update any of the other bindings in the template.
19
21
20
-
Read more about which solution is right for you in ['Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error'](https://indepth.dev/posts/1001/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error) and why this is useful at ['Angular Debugging "Expression has changed after it was checked": Simple Explanation (and Fix)'](https://blog.angular-university.io/angular-debugging/).
22
+
Read more about which solution is right for you in ['Everything you need to know about the "ExpressionChangedAfterItHasBeenCheckedError" error'](https://indepth.dev/posts/1001/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error) and why this is useful at ['Angular Debugging "Expression has changed after it was checked": Simple Explanation (and Fix)'](https://blog.angular-university.io/angular-debugging).
Copy file name to clipboardExpand all lines: aio/content/errors/NG0200.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,14 @@
7
7
A cyclic dependency exists when a [dependency of a service](guide/hierarchical-dependency-injection) directly or indirectly depends on the service itself. For example, if `UserService` depends on `EmployeeService`, which also depends on `UserService`. Angular will have to instantiate `EmployeeService` to create `UserService`, which depends on `UserService`, itself.
8
8
9
9
@debugging
10
-
Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by [mapping out](guide/dependency-injection-in-action) the component, module, or service’s dependencies and identify the loop causing the problem.
10
+
Use the call stack to determine where the cyclical dependency exists. You will be able to see if any child dependencies rely on the original file by [mapping out](guide/dependency-injection-in-action) the component, module, or service's dependencies and identify the loop causing the problem.
11
11
12
-
Break this loop (or circle) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be reliant on one another.
12
+
Break this loop \(or circle\) of dependency to resolve this error. This most commonly means removing or refactoring the dependencies to not be reliant on one another.
Copy file name to clipboardExpand all lines: aio/content/errors/NG0300.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,25 @@
7
7
Two or more components use the same [element selector](guide/component-overview#specifying-a-components-css-selector). Because there can only be a single component associated with an element, selectors must be unique strings to prevent ambiguity for Angular.
8
8
9
9
@debugging
10
-
Use the element name from the error message to search for places where you’re using the same [selector declaration](guide/architecture-components) in your codebase:
10
+
Use the element name from the error message to search for places where you're using the same [selector declaration](guide/architecture-components) in your codebase:
Ensure that each component has a unique CSS selector. This will guarantee that Angular renders the component you expect.
20
22
21
-
If you’re having trouble finding multiple components with this selector tag name, check for components from imported component libraries, such as Angular Material. Make sure you're following the [best practices](guide/styleguide#component-selectors) for your selectors to prevent collisions.
23
+
If you're having trouble finding multiple components with this selector tag name, check for components from imported component libraries, such as Angular Material. Make sure you're following the [best practices](guide/styleguide#component-selectors) for your selectors to prevent collisions.
Copy file name to clipboardExpand all lines: aio/content/errors/NG0301.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
@shortDescription Export not found!
5
5
6
6
@description
7
-
Angular can’t find a directive with `{{ PLACEHOLDER }}` export name. The export name is specified in the `exportAs` property of the directive decorator. This is common when using FormsModule or Material modules in templates, and you’ve forgotten to [import the corresponding modules](guide/sharing-ngmodules).
7
+
Angular can't find a directive with `{{ PLACEHOLDER }}` export name. The export name is specified in the `exportAs` property of the directive decorator. This is common when using FormsModule or Material modules in templates, and you've forgotten to [import the corresponding modules](guide/sharing-ngmodules).
8
8
9
9
<divclass="alert is-helpful">
10
10
@@ -17,16 +17,24 @@ Use the export name to trace the templates or modules using this export.
17
17
18
18
Ensure that all dependencies are [properly imported and declared in your NgModules](guide/sharing-ngmodules). For example, if the export not found is `ngForm`, we need to import `FormsModule` and declare it in the list of imports in `*.module.ts` to resolve the error.
Copy file name to clipboardExpand all lines: aio/content/errors/NG0302.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,24 @@
4
4
@shortDescription Pipe not found!
5
5
6
6
@description
7
-
Angular can't find a pipe with this name.
8
-
The pipe referenced in the template has not been named or declared properly.
7
+
Angular can't find a pipe with this name.
8
+
The pipe referenced in the template has not been named or declared properly.
9
9
A [pipe](guide/pipes) must be either declared or imported in the `NgModule` where it is used, and the name used in a template must match the name defined in the pipe decorator.
10
10
11
11
@debugging
12
12
Use the pipe name to trace the templates or modules where this pipe is declared and used.
13
13
14
14
To resolve this error, ensure that:
15
-
- A local custom pipe is uniquely named in the pipe's decorator, and declared in the `NgModule`, or
16
-
- A pipe from another `NgModule` is added to the imports of the `NgModule` where it is used.
15
+
16
+
* A local custom pipe is uniquely named in the pipe's decorator, and declared in the `NgModule`, or
17
+
* A pipe from another `NgModule` is added to the imports of the `NgModule` where it is used
17
18
18
19
If you recently added an import or declaration, you may need to restart your server to see these changes.
0 commit comments