Skip to content

Commit f05ce1a

Browse files
docs: apply suggestions from code review
Apply editorial suggestions for peer review. Co-authored-by: Tiffany Davis <88161089+TMDavisGoogle@users.noreply.github.com>
1 parent e5ffb92 commit f05ce1a

19 files changed

Lines changed: 44 additions & 42 deletions

aio/content/cli/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ When you use the [ng serve](cli/serve) command to build an application and serve
4747
When you run `ng new my-first-project` a new folder, named `my-first-project`, will be created in the current working directory.
4848
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.
4949

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

5252
</div>
5353

@@ -119,7 +119,7 @@ Options that specify files can be given as absolute paths, or as paths relative
119119

120120
### Schematics
121121

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.
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.
123123
In addition to any general options, each artifact or library defines its own options in a *schematic*.
124124
Schematic options are supplied to the command in the same format as immediate command options.
125125

aio/content/errors/NG0100.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Angular throws an `ExpressionChangedAfterItHasBeenCheckedError` when an expressi
99

1010
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.
1111

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+
This error commonly occurs when you've added template expressions or have begun to implement lifecycle hooks like `ngAfterViewInit` or `ngOnChanges`. It is also common when dealing with loading status and asynchronous operations, or when a child component changes its parent bindings.
1313

1414
@debugging
1515

aio/content/errors/NG0200.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
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.
88

99
@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.
11+
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 identifying the loop causing the problem.
1112

1213
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.
1314

aio/content/errors/NG0301.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@shortDescription Export not found!
55

66
@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).
88

99
<div class="alert is-helpful">
1010

aio/content/errors/NG2003.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
There is no injection token for a constructor parameter at compile time. [InjectionTokens](api/core/InjectionToken) are tokens that can be used in a Dependency Injection Provider.
77

88
@debugging
9-
Look at the parameter that throws the error and all uses of the class.
10-
This error is commonly thrown when a constructor defines parameters with primitive types like `string`, `number`, `boolean`, and `Object`.
9+
Look at the parameter that throws the error, and all uses of the class.
10+
This error is commonly thrown when a constructor defines parameters with primitive types such as `string`, `number`, `boolean`, and `Object`.
1111

1212
Use the `@Injectable` method or `@Inject` decorator from `@angular/core` to ensure that the type you are injecting is reified \(has a runtime representation\). Make sure to add a provider to this decorator so that you do not throw [NG0201: No Provider Found](errors/NG0201).
1313

aio/content/errors/NG3003.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@description
66

7-
A component, directive or pipe that is referenced by this component would require the compiler to add an import that would lead to a cycle of imports.
7+
A component, directive, or pipe that is referenced by this component would require the compiler to add an import that would lead to a cycle of imports.
88
For example, consider a scenario where a `ParentComponent` references a `ChildComponent` in its template:
99

1010
<code-example header="parent.component.ts" path="errors/cyclic-imports/parent.component.ts"></code-example>
@@ -18,7 +18,7 @@ There is already an import from `child.component.ts` to `parent.component.ts` si
1818
**NOTE**: <br />
1919
The parent component's template contains `<child></child>`.
2020
The generated code for this template must therefore contain a reference to the `ChildComponent` class.
21-
In order to make this reference the compiler would have to add an import from `parent.component.ts` to `child.component.ts`, which would cause an import cycle:
21+
In order to make this reference, the compiler would have to add an import from `parent.component.ts` to `child.component.ts`, which would cause an import cycle:
2222

2323
<code-example format="none" language="none">
2424

@@ -30,12 +30,12 @@ parent.component.ts -&gt; child.component.ts -&gt; parent.component.ts
3030

3131
### Remote Scoping
3232

33-
To avoid adding imports that create cycles, additional code is added to the `NgModule` class where the component is declared that wires up the dependencies.
33+
To avoid adding imports that create cycles, additional code is added to the `NgModule` class where the component that wires up the dependencies is declared.
3434
This is known as "remote scoping".
3535

3636
### Libraries
3737

38-
Unfortunately, "remote scoping" code is side-effectful, which prevents tree shaking, and cannot be used in libraries.
38+
Unfortunately, "remote scoping" code is side-effectful &mdash;which prevents tree shaking&mdash; and cannot be used in libraries.
3939
So when building libraries using the `"compilationMode": "partial"` setting, any component that would require a cyclic import will cause this `NG3003` compiler error to be raised.
4040

4141
@debugging
@@ -50,11 +50,11 @@ The component ChildComponent is used in the template but importing it would crea
5050

5151
</code-example>
5252

53-
Use this to identify how the referenced component, pipe or directive has a dependency back to the component being compiled.
53+
Use this to identify how the referenced component, pipe, or directive has a dependency back to the component being compiled.
5454
Here are some ideas for fixing the problem:
5555

56-
* Try to re-arrange your dependencies to avoid the cycle.
57-
For example using an intermediate interface that is stored in an independent file that can be imported to both dependent files without causing an import cycle.
56+
* Try to rearrange your dependencies to avoid the cycle.
57+
For example, using an intermediate interface that is stored in an independent file that can be imported to both dependent files without causing an import cycle.
5858

5959
* Move the classes that reference each other into the same file, to avoid any imports between them.
6060
* Convert import statements to type-only imports \(using `import type` syntax\) if the imported declarations are only used as types, as type-only imports do not contribute to cycles.

aio/content/extended-diagnostics/NG8101.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This diagnostic detects a backwards "banana-in-box" syntax for [two-way bindings
1313
## What's wrong with that?
1414

1515
As it stands, `([var])` is actually an [event binding](guide/event-binding) with the name `[var]`.
16-
The author likely intended this as a two-way binding to a variable named `var` but as written this binding has no effect.
16+
The author likely intended this as a two-way binding to a variable named `var` but, as written, this binding has no effect.
1717

1818
## What should I do instead?
1919

aio/content/extended-diagnostics/NG8102.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This can lead to confusion about the expected output of the program.
3232
## What should I do instead?
3333

3434
Update the template and declared type to be in sync.
35-
Double check the type of the input and confirm whether it is actually expected to be nullable.
35+
Double-check the type of the input and confirm whether it is actually expected to be nullable.
3636

3737
If the input should be nullable, add `null` or `undefined` to its type to indicate this.
3838

aio/content/extended-diagnostics/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
There are many coding patterns that are technically valid to the compiler or runtime, but which may have complex nuances or caveats.
44
These patterns may not have the intended effect expected by a developer, which often leads to bugs.
5-
The Angular compiler includes "extended diagnostics" which identify many of these patterns to warn developers about the potential issues and enforce common best practices within a codebase.
5+
The Angular compiler includes "extended diagnostics" which identify many of these patterns, in order to warn developers about the potential issues and enforce common best practices within a codebase.
66

77
## Diagnostics
88

aio/content/guide/accessibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For example:
6161
See the W3C documentation for more information on [aria-live regions](https://www.w3.org/WAI/PF/aria-1.1/states_and_properties#aria-live).
6262

6363
* The `cdkTrapFocus` directive traps Tab-key focus within an element.
64-
Use it to create accessible experience for components like modal dialogs, where focus must be constrained.
64+
Use it to create accessible experience for components such as modal dialogs, where focus must be constrained.
6565

6666
For full details of these and other tools, see the [Angular CDK accessibility overview](https://material.angular.io/cdk/a11y/overview).
6767

0 commit comments

Comments
 (0)