Files
angular/aio/content/guide
Andrew Scott 79825d3f10 fix(router): Do not call preload method when not necessary (#47007)
In Angular 14, we introduced the `loadComponent` API for a `Route` to
allow lazy loading of a routed component in addition to the existing
`loadChildren` which allows lazy loading of child routes. As a result,
the `preload` method of the `PreloadingStrategy` needs to sometimes be
called even when there is a `canLoad` guard on the `Route`. `CanLoad`
guards block loading of child routes but _do not_ block loading of the
component.

This change updates the conditional checks in the internal preloader to
skip calling the `PreloadingStrategy.preload` when there is only a
`loadChildren` callback with a `canLoad` guard an no `loadComponent`.
In this case, the callback passed to the `preload` method is already
effectively a no-op so it's not necessary to call it at all.

resolves #47003

PR Close #47007
2022-08-02 09:38:28 -07:00
..
2022-07-12 15:56:09 +00:00
2022-04-08 19:36:30 +00:00
2022-04-19 09:26:12 -07:00
2022-08-01 11:15:55 -07:00
2022-04-08 19:36:30 +00:00
2022-04-08 19:36:30 +00:00
2022-04-08 19:36:30 +00:00
2022-08-01 13:00:25 -07:00
2022-04-08 19:36:30 +00:00
2022-04-08 19:36:30 +00:00
2022-04-08 19:36:30 +00:00
2022-04-08 19:36:30 +00:00
2022-08-01 11:15:55 -07:00
2022-04-08 19:36:30 +00:00