Angular · Middle · Question 27 of 75
What happens when a lazy route declares providers?
{ path: "admin", providers: [AdminApi], loadChildren: () => import("./admin.routes") }- ✓Correct answer: Angular creates a separate environment injector for that route and its children
- 2The providers are added to the root injector at startup
- 3Route providers are ignored for lazy routes
Explanation
The services live only under /admin, keep feature code out of the root, and are created when the route is first activated.