docs: add note about why module import order is important (#42323)

Fixes #30223

PR Close #42323
This commit is contained in:
Andrew Scott 2021-05-25 11:13:58 -07:00 committed by Andrew Kushnir
parent 4e9b61aaf9
commit 4cb11cc4e7
1 changed files with 6 additions and 0 deletions

View File

@ -1661,6 +1661,12 @@ _before_ the `AppRoutingModule`:
</code-tabs> </code-tabs>
<div class="alert is-helpful">
The import order of the modules is important because the order of the routes defined in the modules affects route matching.
If the `AppModule` were imported first, its wildcard route (`path: '**'`) would take precedence over the routes defined in `CrisisCenterModule`.
For more information, see the section on [route order](guide/router#route-order).
</div>
Remove the initial crisis center route from the `app-routing.module.ts` because now the `HeroesModule` and the `CrisisCenter` modules provide the feature routes. Remove the initial crisis center route from the `app-routing.module.ts` because now the `HeroesModule` and the `CrisisCenter` modules provide the feature routes.
The `app-routing.module.ts` file retains the top-level application routes such as the default and wildcard routes. The `app-routing.module.ts` file retains the top-level application routes such as the default and wildcard routes.