Bird
0
0

You want to pre-render an Angular app with 1000 routes. What is a practical approach to manage this efficiently?

hard📝 Application Q8 of 15
Angular - Server-Side Rendering
You want to pre-render an Angular app with 1000 routes. What is a practical approach to manage this efficiently?
AGenerate the routes list dynamically in prerender config using a script
BManually list all 1000 routes in the prerender config file
CPre-render only the root route and load others dynamically
DDisable pre-rendering and rely on client-side rendering
Step-by-Step Solution
Solution:
  1. Step 1: Consider scale of routes

    Manually listing 1000 routes is impractical and error-prone.
  2. Step 2: Use dynamic generation

    Generating routes list with a script automates and simplifies prerender config.
  3. Final Answer:

    Generate the routes list dynamically in prerender config using a script -> Option A
  4. Quick Check:

    Dynamic route generation scales better [OK]
Quick Trick: Automate large route lists for prerender [OK]
Common Mistakes:
  • Trying to list thousands of routes manually
  • Skipping pre-rendering for large apps unnecessarily
  • Pre-rendering only root route without reason

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes