Short answer
Put the primary landing page on an eager route, and lazy-load the other pages. A component property ships that component in the same JavaScript bundle as the route config. loadComponent and loadChildren download a separate chunk when the route is needed. Eager makes the next screen available immediately. Lazy cuts the first download and adds a later request.
Last verified against the sources listed below.
Key takeaways
- Eager loading uses the component property. That component is in the same bundle as the route file.
- loadComponent fetches one component when the route would become active.
- loadChildren fetches child routes during route matching, instead of a children array.
- A default export can be returned from import() with no .then. A named export needs .then.
- Angular recommends eager loading for the primary landing page and lazy loading for other pages.
- Nested lazy routes add more round trips. The guide says that can hurt performance.
Lazy loading vs eager loading in Angular is a decision about when the browser downloads a route, and Angular’s routing guide already picks a side. Eager loading is recommended for the primary landing page. Other pages should be lazy-loaded.
Eager means the component is in the first JavaScript bundle, so the next screen is already parsed. Lazy means a separate chunk arrives when the person navigates. The lazy path cuts the first download and adds a later request. Nested lazy routes multiply those later requests.
What is lazy loading vs eager loading in Angular?
Eager loading is the component property. The class is imported at the top of the route file, so the bundler includes it with the route configuration. The browser downloads and parses that JavaScript during the initial page load, and Angular can construct the component immediately.
Lazy loading is loadComponent or loadChildren. loadComponent fetches the component when that route would become active, and loadChildren fetches child routes during route matching. Both take a function that returns a promise, and in the usual case that function is a dynamic import().
MDN’s import() page calls that syntax a dynamic import: it loads an ECMAScript module asynchronously, and only when it is evaluated. It returns a promise of the module’s exports. MDN marks the syntax as available across browsers since January 2020. If the fetch fails, a browser rejects with a TypeError.
The language in those files is the one Ecma publishes. The ECMA-262 page labels the 2026 text as the 17th edition, June 2026, and calls ECMAScript a general-purpose programming language. Angular’s router does not invent a second language for the chunk.
How does an eager route get into the bundle?
You import the component class and set component to that class. The guide’s sample imports HomePage and LoginPage and references both in the routes array. The comment in that sample says their code is eagerly included in the same bundle as the file.
That is the trade the guide names. More JavaScript in the first load means a slower start. The components are then available without another request, so moving from the landing page to login does not wait on a new file. The guide describes that later navigation as smoother because the code is already there.
Keep the eager set small. A landing page and a screen people hit immediately belong there. A settings page, an admin area, and a rarely opened editor do not, if you follow the guide’s general rule. The property name is component, not a flag called eager.
How does a lazy route get requested?
You leave the component class out of the static import list. The route object gets a loader instead.
- For one component, set
loadComponentto an arrow function that returnsimport()of that file. - For a group of child routes, set
loadChildrento an arrow function that returnsimport()of the routes file. - If the file has a default export, return the
import()promise with no.then. - If the export is named, add
.thenand returnmod.ROUTESor the component class. - If the file depends on a flag, call
inject()inside the loader and then return the matchingimport().
The LoadChildrenCallback page says the function must be an arrow function of the form () => import('...').then(mod => mod.ROUTES), or the same shape for mod.MODULE. It also says the .then can be omitted for a default export. loadComponent uses the same import pattern for a component rather than a route list.
The router runs those loaders in the route’s injection context. inject() can see providers on that route, providers inherited from a parent, and providers available globally. The guide’s sample reads a feature flag and imports either a premium dashboard or a basic one. The chunk that was not chosen is not requested.
JavaScript is what those chunks contain. Node.js is a separate runtime for that language, aimed at network applications. The Angular router described here is the browser case: the chunk is requested when the route matches, not when a server process starts.
When should you choose eager loading?
Choose eager loading for the primary landing page, which is the guide’s general recommendation. Choose it for a second screen that almost everyone opens in the same session, when you would rather pay for it in the first download than on the click.
Choose it when the component is small and pulling it into the main bundle does not change the first load in a way you care about. The guide does not publish a byte threshold. It only contrasts “slower initial load” with a transition that does not wait.
Do not choose eager loading for every route in a large app. The same page says including more JavaScript up front slows the initial load. An admin area, a report, and a flow most visits never reach are the routes the lazy section is written for.
When should you choose lazy loading?
Choose lazy loading for pages that are not the landing page. The guide says this can significantly improve load speed by taking large portions of JavaScript out of the initial bundle. Those portions compile into separate chunks. The router requests a chunk when the person visits that route.
Choose loadComponent when one component is the route. Choose loadChildren when the route owns a set of child routes that should arrive together. The API page’s contrast is explicit: lazy loading uses loadChildren instead of children.
Be careful with nesting. The guide’s note says lazy routes reduce the initial data and add future requests, and that this is particularly true of nested lazy loading at multiple levels, which can significantly affect performance. One lazy boundary around a section is the pattern the samples show. A lazy route inside a lazy route inside another lazy route is the case the note warns about.
Images on that route are a different budget. An image compressor shrinks a picture the route will fetch, and it does not change loadComponent.
Page speed still depends on both the script chunk and the bytes the screen asks for after it runs.
| Choice | Route field | When the bytes download | Guide’s advice |
|---|---|---|---|
| Eager | component | With the initial bundle | Primary landing page |
| Lazy component | loadComponent | When that route would become active | Other pages |
| Lazy children | loadChildren | During route matching | A group of child routes |
| Static children | children | With the parent configuration | Not the lazy path |
| Flag inside the loader | loadComponent plus inject() | Whichever file the flag selects | One of the two imports, not both |
Frequently asked questions
Is loadChildren the same as children?
No. The LoadChildrenCallback page says lazy loading uses loadChildren on the route instead of children. children would be part of the configuration you already shipped. loadChildren is a function that returns a promise of routes, usually through a dynamic import. The router calls that function while it is matching, not when the source file was first parsed. Use children only for routes that should be in the eager configuration.
When can you skip .then?
Both the loading-strategies guide and the LoadChildrenCallback page say you can skip .then when the file uses a default export. You return the import() promise directly. A named export still needs .then to pick the class or the routes constant, in the form import().then(mod => mod.ROUTES) or import().then(mod => mod.MODULE). Mixing those up loads the module namespace and not the component you meant.
Can the loader call inject()?
Yes. The router runs loadComponent and loadChildren inside the injection context of the current route. The guide shows inject() reading a feature-flag service and then choosing which file to import. Those providers can be declared on the route, inherited from a parent, or available globally. The loader is still an arrow function that returns a promise. inject() does not itself download the chunk.
Does lazy loading remove the need to shrink images?
No. Lazy routes remove JavaScript from the first bundle. They do not change the bytes of an image that the route then requests. A large photo on a lazy page still downloads when that page opens. Compressing the image is a separate cut. The routing guide's warning is about extra JavaScript requests, especially nested ones, not about picture formats.
What language is inside the chunk?
The chunk is JavaScript, which Ecma's ECMA-262 page defines as the ECMAScript language. The 2026 publication on that page is the 17th edition, June 2026. MDN calls import() a dynamic import that loads an ECMAScript module and returns a promise. Angular's loader is that call. The browser downloads the chunk. A server runtime such as Node.js is a different host for the same language.
Sources
- Route loading strategies · Angular, 2026
- LoadChildrenCallback · Angular, 2026
- import() · MDN, 2026
- ECMA-262 · Ecma International, 2026
- About Node.js · Node.js, 2026