Angular 17 Feature defer loading | Deferrable views | Lazy loading components | Angular 17 Tutorial

preview_player
Показать описание
Angular 17 Feature deferred loading | Angular 17 Defer block: Create Lazy Loaded components with a `when` trigger! Learn how to create a lazy-loaded component in Angular 17 using the new defer block with the `when` trigger. It's really powerful!

Angular 17 Feature: deferred loading: Using @defer in Angular 17 to implement lazy loading.

Angular 17 introduced a new @defer block that lets your lazy-load content based on specific conditions or events and deferred blocks support the following declarative trigger types:

1. on interaction - @defer (on interaction)
2. on hover - @defer (on hover)
3. on idle - @defer (on idle)
4. on timer - @defer (on timer(4s))
5. on viewport - @defer (on viewport)

Angular renders the on-interaction block when the user interacts with its @placeholder block. An interaction can be a click, touch focus, or input event, like keypress.

@defer (on interaction) {
Content block: Clicked on the interaction
}
@placeholder {
Content block: Placeholder – on interaction(click on it)
}
@error {
Content block: Error
}
@loading(minimum 2s) {
Loading...
}

Angular 17 Tutorial:-
*********************

#angular17 #Angular17defer #loading #AngularLazyloading #AngularDeferrableView #AngularInteraction #AngularHover #AngularIdle #AngularTimer #AngularViewport
Рекомендации по теме