-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: several small fixes/improvements/refactorings for the guides #21589
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent. Thank you so much, @gkalpak!!
You can preview 2163fb1 at https://pr21589-2163fb1.ngbuilds.io/. |
aio/content/guide/feature-modules.md
Outdated
@@ -130,5 +126,3 @@ You may also be interested in the following: | |||
* [Lazy Loading Modules with the Angular Router](guide/lazy-loading-ngmodules). | |||
* [Providers](guide/providers). | |||
* [Types of NgModules](guide/module-types). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the text for this link need to change to Types of Feature Modules
?
@@ -189,4 +189,3 @@ The following table summarizes the key characteristics of each feature module gr | |||
You may also be interested in the following: | |||
* [Lazy Loading Modules with the Angular Router](guide/lazy-loading-ngmodules). | |||
* [Providers](guide/providers). | |||
* [Types of NgModules](guide/module-types). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL - you might also be interested in "this page"!
aio/content/guide/ngmodule-api.md
Outdated
<ol> | ||
<li>When compiling a template, you need to determine a set of selectors which should be used for triggering their corresponding directives.</li> | ||
<li> | ||
The template is compiled within a context of an `NgModule`—the `NgModule` which this template's component is declared in—which determines the set of selectors using the following rules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"within the context"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the NgModule within which the template's component is declared"
aio/content/guide/ngmodule-api.md
Outdated
The template is compiled within a context of an `NgModule`—the `NgModule` which this template's component is declared in—which determines the set of selectors using the following rules: | ||
<ul> | ||
<li>All selectors of directives listed in `declarations`.</li> | ||
<li>All exported selectors of imported `NgModules`.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"All selectors of directives exported from imported NgModules
"?
aio/content/guide/ngmodule-api.md
Outdated
|
||
<tr> | ||
A list of modules which should be folded into this module. Folded means it is | ||
as if all of the imported NgModule properties were declared here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"all the imported NgModule
's exported properties"
aio/content/guide/ngmodule-faq.md
Outdated
|
||
## What should I export? | ||
|
||
Export [declarable](guide/bootstrapping#the-declarations-array) classes that components in _other_ NgModules | ||
are able to reference in their templates. These are your _public_ classes. | ||
If you don't export a class, it stays _private_, visible only to other component | ||
If you don't export a declarable class, it stays _private_, visible only to other component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other components
@@ -55,13 +55,13 @@ of some of the things they contain: | |||
|
|||
<tr> | |||
<td><code>RouterModule</code></td> | |||
<td><code>@angular/forms</code></td> | |||
<td><code>@angular/router</code></td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops :-)
|
||
<hr /> | ||
|
||
## Providing a singleton service | ||
|
||
An injector created from a module definition will have services which are singletons with respect to that injector. To control the lifetime of services, one controls the creation and destruction of injectors. For example, a route will have an associated module. When the route is activated, an injector is created from that module as a child of the current injector. When you navigate away from the route, the injector is destroyed. This means that services declared in a route module will have a lifetime equal to that of the route. Similarly, services provided in an application module will have the same lifetime of the application, hence singleton. | ||
An injector created from a module definition will have services which are singletons with respect to that injector. To control the lifetime of services, one controls the creation and destruction of injectors. For example, a route will have an associated module. When the route is activated, an injector is created from that module as a child of the current injector. When you navigate away from the route, the injector is destroyed. This means that services declared in a route module will have a lifetime equal to that of the route. Similarly, services provided in an application module will have the same lifetime of the application, hence singleton. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely this line should be broken into shorter lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish all lines were limited to 100 chars :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits that I think would benefit this PR but nothing to really stop it from landing.
2163fb1
to
d53e55c
Compare
You can preview d53e55c at https://pr21589-d53e55c.ngbuilds.io/. |
Incorporated @petebacondarwin's suggestions. ❤️ |
…-snippets lang) (angular#21589) PR Close angular#21589
…-snippets lang) (angular#21589) PR Close angular#21589
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Checklist
Tests for the changes have been added (for bug fixes / features)PR Type
What is the current behavior?
Some minor issues (typos, inconsistentcies, wrong/incomplete examples).
What is the new behavior?
Less minor issues.
Does this PR introduce a breaking change?
Related: #21517, #21531