Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 8a3d061

Browse files
authored
docs(router): fix grammar typo in preloader section (#2700)
tweaks some other related language.
1 parent 32f3ed9 commit 8a3d061

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

public/docs/ts/latest/guide/router.jade

+12-11
Original file line numberDiff line numberDiff line change
@@ -2148,28 +2148,28 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
21482148
* No pre-loading at all which is the default. Lazy loaded feature areas are still loaded on demand.
21492149
* Pre-loading of all lazy loaded feature areas.
21502150

2151-
The *Router* also supports [custom preloading strategies](#custom-preloading) to give us control of what we want to pre-load.
2151+
The *Router* also supports [custom preloading strategies](#custom-preloading) for fine control over which modules to pre-load.
21522152

2153-
We'll update our *CrisisCenterModule* to be loaded lazily by default and use the `PreloadAllModules` strategy to eagerly
2154-
it up.
2153+
We'll update our *CrisisCenterModule* to be loaded lazily by default and use the `PreloadAllModules` strategy
2154+
to load _all_ lazy loaded modules as soon as possible.
21552155

21562156
<a id="preload-canload"></a>
21572157
.l-sub-section
21582158
:marked
2159-
The **PreloadAllModules** strategy does not eagerly load feature areas protected by the [Can Load](#can-load-guard) and this is by design.
2160-
The *CanLoad* guard protects against loading feature area assets until authorized to do so. If you want to eagerly load all modules and guard
2161-
them against unauthorized access, use the [CanActivate](#can-activate-guard) guard instead.
2159+
The **PreloadAllModules** strategy does not load feature areas protected by a [CanLoad](#can-load-guard) guard and this is by design.
2160+
The *CanLoad* guard blocks loading of feature module assets until authorized to do so. If you want to both preload a module and guard
2161+
against unauthorized access, use the [CanActivate](#can-activate-guard) guard instead.
21622162

21632163
:marked
2164-
We'll update our route configuration to eagerly load the *CrisisCenterModule*. We follow the same process as we did when we loaded the *AdminModule* asynchronously.
2164+
We'll update our route configuration to lazy load the *CrisisCenterModule*. We follow the same process as we did when we loaded the *AdminModule* asynchronously.
21652165
In the *crisis-center-routing.module.ts*, we'll change the *crisis-center* path to an *empty path* route.
21662166

21672167
We'll move our redirect and *crisis-center* route to our `AppRoutingModule` routes and use the `loadChildren` string to load the *CrisisCenterModule*.
21682168
The redirect is also changed to load the `/heroes` route on initial load.
21692169

21702170
Once we're finished, we'll remove the `CrisisCenterModule` from our `AppModule`'s imports.
21712171

2172-
Here are our updated modules:
2172+
Here are the updated modules _before enabling preload_:
21732173

21742174
+makeTabs(
21752175
`router/ts/app/app.module.ts,
@@ -2183,9 +2183,10 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
21832183
`)
21842184

21852185
:marked
2186-
In order to enable pre-loading of all modules, we'll import the `PreloadAllModules` token from the router package. The second argument in the
2187-
`RouterModule.forRoot` method takes an object where we can provide additional configuration options. We'll use the `preloadingStrategy` property
2188-
with the `PreloadAllModules` token. This enables the built-in *Router* pre-loader to eagerly load **all** [unguarded](#preload-canload) feature areas that use `loadChildren`.
2186+
The second argument in the `RouterModule.forRoot` method takes an object for additional configuration options.
2187+
We import the `PreloadAllModules` token from the router package and set the configuration option's `preloadingStrategy` property
2188+
with this `PreloadAllModules` token.
2189+
This tells the built-in *Router* pre-loader to immediately load **all** [unguarded](#preload-canload) feature areas that use `loadChildren`.
21892190

21902191
+makeExcerpt('app/app-routing.module.6.ts (preload all)', '')
21912192

0 commit comments

Comments
 (0)