December 19, 2023
One of the most interesting features introduced recently in Angular 17 is the new partial template loading syntax: the @defer block.
Here is a quick demo of how the new @defer feature works:
📺 Watch on YouTube: "Angular 17 Partial Template Loading: The new @defer Syntax"
What is partial template loading?
This means that you can now load on the background a feature that the user will likely need, but without having to include it in the main application bundle.
You can for example, preload on the background a print PDF feature that uses a heavy third-party library, but only apply the feature to the template if the user clicks on a button.
This feature is meant to be used in combination with lazy-loading, so one feature does not replace the other.