docs: add server side redirect and fix NgModule FAQ links (#21487)

PR Close #21487
This commit is contained in:
Kapunahele Wong 2018-01-11 15:38:51 -05:00 committed by Chuck Jazdzewski
parent e79e98ab44
commit 02377335ec
5 changed files with 9 additions and 3 deletions

View File

@ -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`:
<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>

View File

@ -338,6 +338,7 @@ Define child routes and let the router load module components into that outlet.
<hr/>
<a id="q-root-component-or-module"></a>
{@ q-root-component-or-module}
## 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/>
<a id="q-component-or-module"></a>
{@ q-component-or-module}
## Should I add other providers to a module or a component?
@ -394,6 +396,7 @@ not the root `AppComponent`.
<hr/>
<a id="q-why-bad"></a>
{@ q-why-bad}
## Why is it bad if a shared module provides a service to a lazy-loaded module?

View File

@ -55,7 +55,7 @@ having to import it directly into the `@NgModule` decorator.
### Using components vs services from other modules.
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.
The most common way to get a hold of sharedservices is through Angular

View File

@ -49,6 +49,9 @@
// aot-compiler.md and metadata.md combined into aot-compiler.md - issue #19510
{"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
{"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"},

View File

@ -19,7 +19,7 @@
"routing": {
"index": "/index.html",
"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"
}
}