docs(router): Fix typos (#2666)
This commit is contained in:
parent
e7bcc72610
commit
32f3ed973d
|
@ -2138,7 +2138,7 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
|
||||||
We've learned how to load modules on-demand, but we can also take advantage of loading feature areas modules in *advance*. The *Router*
|
We've learned how to load modules on-demand, but we can also take advantage of loading feature areas modules in *advance*. The *Router*
|
||||||
supports **pre-loading** of asynchronous feature areas prior to navigation to their respective URL. Pre-loading allows us to to load our initial route
|
supports **pre-loading** of asynchronous feature areas prior to navigation to their respective URL. Pre-loading allows us to to load our initial route
|
||||||
quickly, while other feature modules are loaded in the background. Once we navigate to those areas, they will have already been loaded
|
quickly, while other feature modules are loaded in the background. Once we navigate to those areas, they will have already been loaded
|
||||||
as if our they were included in our initial bundle.
|
as if they were included in our initial bundle.
|
||||||
|
|
||||||
Each time a **successful** navigation happens, the *Router* will look through our configuration for lazy loaded feature areas
|
Each time a **successful** navigation happens, the *Router* will look through our configuration for lazy loaded feature areas
|
||||||
and react based on the provided strategy.
|
and react based on the provided strategy.
|
||||||
|
@ -2151,7 +2151,7 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
|
||||||
The *Router* also supports [custom preloading strategies](#custom-preloading) to give us control of what we want to pre-load.
|
The *Router* also supports [custom preloading strategies](#custom-preloading) to give us control of what we want to pre-load.
|
||||||
|
|
||||||
We'll update our *CrisisCenterModule* to be loaded lazily by default and use the `PreloadAllModules` strategy to eagerly
|
We'll update our *CrisisCenterModule* to be loaded lazily by default and use the `PreloadAllModules` strategy to eagerly
|
||||||
it them up initial navigation.
|
it up.
|
||||||
|
|
||||||
<a id="preload-canload"></a>
|
<a id="preload-canload"></a>
|
||||||
.l-sub-section
|
.l-sub-section
|
||||||
|
@ -2191,7 +2191,7 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
|
||||||
|
|
||||||
:marked
|
:marked
|
||||||
Now when we visit `http://localhost:3000`, the `/heroes` route will load in the foreground, while the *CrisisCenterModule* and any other asynchronous feature
|
Now when we visit `http://localhost:3000`, the `/heroes` route will load in the foreground, while the *CrisisCenterModule* and any other asynchronous feature
|
||||||
modules we could have are _eagerly_ loaded in the background, waiting for us to navigate to them.
|
modules are _eagerly_ loaded in the background, waiting for us to navigate to them.
|
||||||
|
|
||||||
<a id="custom-preloading"></a>
|
<a id="custom-preloading"></a>
|
||||||
:marked
|
:marked
|
||||||
|
@ -2204,9 +2204,9 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
|
||||||
We can define our own strategy the same way the **PreloadAllModules** modules strategy was provided to our *RouterModule.forRoot* configuration object.
|
We can define our own strategy the same way the **PreloadAllModules** modules strategy was provided to our *RouterModule.forRoot* configuration object.
|
||||||
|
|
||||||
Since we want to take advantage of this, we'll add a custom strategy that _only_ preloads the modules we select. We'll enable the preloading by using the *Route Data*,
|
Since we want to take advantage of this, we'll add a custom strategy that _only_ preloads the modules we select. We'll enable the preloading by using the *Route Data*,
|
||||||
which we learned is an object to store arbitrary route data and and [resolve data](#resolve-guard).
|
which, as we learned, is an object to store arbitrary route data and and [resolve data](#resolve-guard).
|
||||||
|
|
||||||
We'll add a custom `preload` boolean to our `crisis-center` route data that we'll use with our custom strategy. To see it in action, we'll add to
|
We'll add a custom `preload` boolean to our `crisis-center` route data that we'll use with our custom strategy. To see it in action, we'll add
|
||||||
the `route.path` to the `preloadedModules` array in our custom strategy service. We'll also log a message
|
the `route.path` to the `preloadedModules` array in our custom strategy service. We'll also log a message
|
||||||
to the console for the preloaded module.
|
to the console for the preloaded module.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue