docs: add server side redirect and fix NgModule FAQ links (#21487)
PR Close #21487
This commit is contained in:
parent
e79e98ab44
commit
02377335ec
|
@ -104,7 +104,7 @@ When the CLI generated the `CustomerDashboardComponent` for the feature module,
|
||||||
|
|
||||||
To see this HTML in the `AppComponent`, you first have to export the `CustomerDashboardComponent` in the `CustomerDashboardModule`. In `customer-dashboard.module.ts`, just beneath the declarations array, add an exports array containing `CustomerDashboardModule`:
|
To see this HTML in the `AppComponent`, you first have to export the `CustomerDashboardComponent` in the `CustomerDashboardModule`. In `customer-dashboard.module.ts`, just beneath the declarations array, add an exports array containing `CustomerDashboardModule`:
|
||||||
|
|
||||||
<code-example path="feature-modules/src/app/customer-dashboard/customer-dashboard.module.ts" region="customer-dashboard-component" title="src/app/customer-dashboard.module.ts" linenums="false">
|
<code-example path="feature-modules/src/app/customer-dashboard/customer-dashboard.module.ts" region="component-exports" title="src/app/customer-dashboard.module.ts" linenums="false">
|
||||||
</code-example>
|
</code-example>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,7 @@ Define child routes and let the router load module components into that outlet.
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<a id="q-root-component-or-module"></a>
|
<a id="q-root-component-or-module"></a>
|
||||||
|
|
||||||
{@ q-root-component-or-module}
|
{@ q-root-component-or-module}
|
||||||
|
|
||||||
## Should I add application-wide providers to the root `AppModule` or the root `AppComponent`?
|
## Should I add application-wide providers to the root `AppModule` or the root `AppComponent`?
|
||||||
|
@ -372,6 +373,7 @@ This means that lazy-loaded modules can't reach them.
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
<a id="q-component-or-module"></a>
|
<a id="q-component-or-module"></a>
|
||||||
|
|
||||||
{@ q-component-or-module}
|
{@ q-component-or-module}
|
||||||
|
|
||||||
## Should I add other providers to a module or a component?
|
## Should I add other providers to a module or a component?
|
||||||
|
@ -394,6 +396,7 @@ not the root `AppComponent`.
|
||||||
<hr/>
|
<hr/>
|
||||||
|
|
||||||
<a id="q-why-bad"></a>
|
<a id="q-why-bad"></a>
|
||||||
|
|
||||||
{@ q-why-bad}
|
{@ q-why-bad}
|
||||||
|
|
||||||
## Why is it bad if a shared module provides a service to a lazy-loaded module?
|
## Why is it bad if a shared module provides a service to a lazy-loaded module?
|
||||||
|
|
|
@ -55,7 +55,7 @@ having to import it directly into the `@NgModule` decorator.
|
||||||
### Using components vs services from other modules.
|
### Using components vs services from other modules.
|
||||||
|
|
||||||
There is an important distinction between using another module's component and
|
There is an important distinction between using another module's component and
|
||||||
using a service from another module.. Import modules when you want to use
|
using a service from another module. Import modules when you want to use
|
||||||
directives, pipes, and components. Importing a module with services means that you will have a new instance of that service, which typically is not what you need, (typically one wants to reuse an existing service.) Use module imports to control service instantiation.
|
directives, pipes, and components. Importing a module with services means that you will have a new instance of that service, which typically is not what you need, (typically one wants to reuse an existing service.) Use module imports to control service instantiation.
|
||||||
|
|
||||||
The most common way to get a hold of sharedservices is through Angular
|
The most common way to get a hold of sharedservices is through Angular
|
||||||
|
|
|
@ -49,6 +49,9 @@
|
||||||
// aot-compiler.md and metadata.md combined into aot-compiler.md - issue #19510
|
// aot-compiler.md and metadata.md combined into aot-compiler.md - issue #19510
|
||||||
{"type": 301, "source": "/guide/metadata", "destination": "/guide/aot-compiler"},
|
{"type": 301, "source": "/guide/metadata", "destination": "/guide/aot-compiler"},
|
||||||
|
|
||||||
|
// ngmodule.md renamed to ngmodules.md
|
||||||
|
{"type": 301, "source": "/guide/ngmodule", "destination": "/guide/ngmodules"}
|
||||||
|
|
||||||
// service-worker-getstart.md, service-worker-comm.md, service-worker-configref.md
|
// service-worker-getstart.md, service-worker-comm.md, service-worker-configref.md
|
||||||
{"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"},
|
{"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"},
|
||||||
{"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"},
|
{"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"},
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
"routing": {
|
"routing": {
|
||||||
"index": "/index.html",
|
"index": "/index.html",
|
||||||
"routes": {
|
"routes": {
|
||||||
"^(?!/docs/ts/latest|/guide/(?:cli-quickstart|metadata|service-worker-(?:getstart|comm|configref))/?$|/styleguide).*/(?!e?plnkr)[^/.]*$": {
|
"^(?!/docs/ts/latest|/guide/(?:cli-quickstart|metadata|ngmodule|service-worker-(?:getstart|comm|configref))/?$|/styleguide).*/(?!e?plnkr)[^/.]*$": {
|
||||||
"match": "regex"
|
"match": "regex"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue