Angular Router: Preloading Modules
Victor Savkin
4008

Hi ! Congrats for the article, it’s awesome !

I’ve tried to make it work, and there’s one little thing I’ve had to change.

In the PreloadingStrategy implementation, at the ternary operator, two things:

  1. Route.data.preload is not an existing property at the moment of the evaluation.
  2. of(null) is a sentence that ts doesn´t compile.

So, I ve changed this :

return route.data && route.data.preload ? load() : of(null);

For this:

return route.data && route.data[‘preload’] ? load() : Observable.of(null);

I wish someone find this helpful !

Congrats again ! :)

Like what you read? Give JC.Díez © a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.