Enea Jahollari
Apr 21, 2023

--

Instead of using the component directly, we can lazy load every component that we use, and by doing this we save on bundle size.

so instead of:

component: ImageComponent

we can do:

component: () => import('./image.component).then(x => x.ImageComponent);

We can't do this with ngIf or ngSwitch.

Hope it helps. 🙌

--

--

Enea Jahollari
Enea Jahollari

Written by Enea Jahollari

GDE for Angular | Software Engineer @ push-based.io | Performance & architecture enthusiast

No responses yet