Optimizing the experience – Resolve
Performance is one of the biggest variables that impact the experience and satisfaction of our users; therefore, optimal performance should be a constant goal for the web developer.
Perceived perception is the game we want to win, and we have plenty of options in the Angular ecosystem. We can load the information that our page will require before it renders and, for that, we will use the Resolveroute saver resource.
Unlike the guard we studied earlier, its purpose is to return information needed by the page being directed by the route.
We will create this guard using the Angular CLI. In your command prompt, use the following command:
ng g resolver diary/diary
In the new file created, let’s change the function that the Angular CLI generated:
export const diaryResolver: ResolveFn<ExerciseSetListAPI> = (route, state) => { const exerciseSetsService = inject(ExerciseSetsService); return exerciseSetsService...