From 02377335ece28352a7ed34443de3139ed56cc963 Mon Sep 17 00:00:00 2001 From: Kapunahele Wong Date: Thu, 11 Jan 2018 15:38:51 -0500 Subject: [PATCH] docs: add server side redirect and fix NgModule FAQ links (#21487) PR Close #21487 --- aio/content/guide/feature-modules.md | 2 +- aio/content/guide/ngmodule-faq.md | 3 +++ aio/content/guide/sharing-ngmodules.md | 2 +- aio/firebase.json | 3 +++ aio/ngsw-manifest.json | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/aio/content/guide/feature-modules.md b/aio/content/guide/feature-modules.md index 890f0baf27..e29cfa6c0b 100644 --- a/aio/content/guide/feature-modules.md +++ b/aio/content/guide/feature-modules.md @@ -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`: - + diff --git a/aio/content/guide/ngmodule-faq.md b/aio/content/guide/ngmodule-faq.md index 2f8409c561..0a6738934a 100644 --- a/aio/content/guide/ngmodule-faq.md +++ b/aio/content/guide/ngmodule-faq.md @@ -338,6 +338,7 @@ Define child routes and let the router load module components into that outlet.
+ {@ 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.
+ {@ q-component-or-module} ## Should I add other providers to a module or a component? @@ -394,6 +396,7 @@ not the root `AppComponent`.
+ {@ q-why-bad} ## Why is it bad if a shared module provides a service to a lazy-loaded module? diff --git a/aio/content/guide/sharing-ngmodules.md b/aio/content/guide/sharing-ngmodules.md index c5e4e6a515..e971294463 100644 --- a/aio/content/guide/sharing-ngmodules.md +++ b/aio/content/guide/sharing-ngmodules.md @@ -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 diff --git a/aio/firebase.json b/aio/firebase.json index a41d85931f..6dcbc99227 100644 --- a/aio/firebase.json +++ b/aio/firebase.json @@ -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"}, diff --git a/aio/ngsw-manifest.json b/aio/ngsw-manifest.json index e2a077482c..da6ad6af2d 100644 --- a/aio/ngsw-manifest.json +++ b/aio/ngsw-manifest.json @@ -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" } }