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: aio/content/cli/index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ When you use the [ng serve](cli/serve) command to build an application and serve
47
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
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.
49
49
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>`.
51
51
52
52
</div>
53
53
@@ -119,7 +119,7 @@ Options that specify files can be given as absolute paths, or as paths relative
119
119
120
120
### Schematics
121
121
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.
123
123
In addition to any general options, each artifact or library defines its own options in a *schematic*.
124
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
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Angular throws an `ExpressionChangedAfterItHasBeenCheckedError` when an expressi
9
9
10
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.
11
11
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.
Copy file name to clipboardExpand all lines: aio/content/errors/NG0200.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@
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.
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.
11
12
12
13
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/NG0301.md
+1-1Lines changed: 1 addition & 1 deletion
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).
Copy file name to clipboardExpand all lines: aio/content/errors/NG2003.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
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.
7
7
8
8
@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`.
11
11
12
12
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).
Copy file name to clipboardExpand all lines: aio/content/errors/NG3003.md
+7-7Lines changed: 7 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
5
5
@description
6
6
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.
8
8
For example, consider a scenario where a `ParentComponent` references a `ChildComponent` in its template:
@@ -18,7 +18,7 @@ There is already an import from `child.component.ts` to `parent.component.ts` si
18
18
**NOTE**: <br />
19
19
The parent component's template contains `<child></child>`.
20
20
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:
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.
34
34
This is known as "remote scoping".
35
35
36
36
### Libraries
37
37
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—which prevents tree shaking— and cannot be used in libraries.
39
39
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.
40
40
41
41
@debugging
@@ -50,11 +50,11 @@ The component ChildComponent is used in the template but importing it would crea
50
50
51
51
</code-example>
52
52
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.
54
54
Here are some ideas for fixing the problem:
55
55
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.
58
58
59
59
* Move the classes that reference each other into the same file, to avoid any imports between them.
60
60
* 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.
Copy file name to clipboardExpand all lines: aio/content/extended-diagnostics/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
There are many coding patterns that are technically valid to the compiler or runtime, but which may have complex nuances or caveats.
4
4
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.
0 commit comments