{"id":38452,"date":"2025-05-12T17:49:23","date_gmt":"2025-05-12T12:19:23","guid":{"rendered":"https:\/\/mobisoftinfotech.com\/resources\/?p=38452"},"modified":"2025-11-20T11:06:37","modified_gmt":"2025-11-20T05:36:37","slug":"angular-performance-defer-tutorial","status":"publish","type":"post","link":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial","title":{"rendered":"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer"},"content":{"rendered":"<p>Have you ever built a dashboard that feels slow or unresponsive right after loading? Or a page that tries to load everything at once, even parts the user hasn\u2019t even scrolled to yet? As Angular apps grow, so does the initial rendering cost, which can make the app feel sluggish. While Angular has always offered tools like *ngIf for conditionally showing content and Angular lazy-loaded modules to split up large apps, these tools haven&#8217;t made it easy to control conditional rendering in smaller, more specific parts of a page.<\/p>\n\n\n\n<p>You might wonder: why render things no one\u2019s even looking at yet? Why not save those precious CPU cycles for something more important? Enter Angular @defer, our performance hero, swooping in to slash initial load times and bring some sanity back to your rendering logic<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is @defer?<\/strong><\/h2>\n\n\n\n<p>Starting with Angular 17, you can now use @defer syntax in Angular to delay rendering certain parts of your templates. This new feature, called deferred views in Angular, gives you a simple and powerful way to control when specific parts of the UI should appear. Whether it&#8217;s waiting for user interaction, scrolling to a section, or even waiting for a certain condition to be met, @defer helps you load only what&#8217;s needed, when it&#8217;s needed. This can greatly improve both actual performance and how fast the app feels to users, all without adding much complexity for developers. Many companies looking to <a href=\"https:\/\/mobisoftinfotech.com\/services\/hire-angular-developers\"><strong>hire angular developers<\/strong><\/a> are now using these strategies to build high-performing web apps<\/p>\n\n\n\n<p>The @defer block is a structural syntax that tells Angular, &#8220;Wait to render this part of the view until certain conditions are met.&#8221; It&#8217;s more than just Angular lazy loading. It&#8217;s an intelligent, conditional rendering technique that supports Angular template optimization.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-heavy-widget<\/span> \/&gt;<\/span>\n\n&nbsp;}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In the example above, &lt;app-heavy-widget&gt; won&#8217;t be created immediately with the rest of the page. Instead, Angular will defer its rendering, resulting in a faster, lighter initial page load.<br><br>This aligns with Angular rendering strategies aimed at improving performance and user experience. It\u2019s a common approach in modern<a href=\"https:\/\/mobisoftinfotech.com\/services\/web-application-development-company\"> <strong>web application development<\/strong><\/a>, where performance-driven conditional rendering is critical for scalable UI solutions.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/mobisoftinfotech.com\/services\/hire-angular-developers?utm_source=blog&amp;utm_medium=angular-performance-defer-tutorial-cta1 \"><noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/hire-angular-developer-performance.png\" alt class=\"wp-image-38463\" title=\"Power Your Applications with Expert Angular Developers\"><\/noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E\" alt class=\"wp-image-38463 lazyload\" title=\"Power Your Applications with Expert Angular Developers\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/hire-angular-developer-performance.png\"><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Which Dependencies Can Be Deferred?<\/strong><\/h2>\n\n\n\n<p>For anything inside a @defer block to be truly lazy-loaded, these two rules apply:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>They must be standalone components. If a dependency isn\u2019t standalone, it will still load eagerly, even if it&#8217;s inside a @defer block.<\/li>\n\n\n\n<li>They shouldn\u2019t be used elsewhere in the same file. If a component, directive, or pipe is referenced outside the @defer block (like with ViewChild), it can&#8217;t be deferred.<\/li>\n<\/ul>\n\n\n\n<p>The good news? Their inner dependencies (transitive ones) can still be a mix of standalone or NgModule-based and will be deferred along with them, making Angular bundle splitting more efficient.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Built-In Triggers: When Does It Load?<\/strong><\/h2>\n\n\n\n<p>Angular hands you the remote. You decide exactly when a deferred view in Angular should come to life. Whether it&#8217;s user interaction, viewport visibility, or custom conditions, you&#8217;ve got fine-grained control at your fingertips.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>when &lt;condition&gt;<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (when isDataLoaded) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-user-profile<\/span> \/&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Renders only when isDataLoaded becomes true or any other condition you choose to define. This supports deferred loading in Angular applications where rendering is tied to reactive states.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>when idle<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (when idle) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-analytics-widget<\/span> \/&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Perfect for non-critical widgets that can wait their turn, rendered when the browser is idle and free from heavy operations. This is useful for improving core web vitals in Angular apps.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>on timer(&lt;ms&gt;)<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (on timer(3000)) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-product-ad<\/span> \/&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Renders after a 3-second delay. Great for popups, ads or content below-the-fold.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>when visible<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (when visible) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-footer<\/span> \/&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Uses Intersection Observer to defer rendering until the element scrolls into view.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Enhancing UX: Placeholders, Loading &amp; Error States<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-placeholder.png\" alt=\"Deferred loading in Angular using placeholders loading and error blocks\" class=\"wp-image-38465\" title=\"Enhance UX in Angular with @placeholder, @loading, and @error blocks\"><\/noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E\" alt=\"Deferred loading in Angular using placeholders loading and error blocks\" class=\"wp-image-38465 lazyload\" title=\"Enhance UX in Angular with @placeholder, @loading, and @error blocks\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-placeholder.png\"><\/figure>\n\n\n\n<p>Deferred views in Angular aren\u2019t just about performance,they\u2019re also a big win for user experience. Without proper feedback, delayed content can leave users confused, staring at a blank space with no idea what&#8217;s happening. That\u2019s where sub-blocks like Angular @placeholder block, @loading block, and @error block come to the rescue to improve Angular template optimization.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What Could Go Wrong Without Them?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Empty Gaps:<\/strong>&nbsp; If a deferred component is loading but there\u2019s no visual cue, users may think the app is broken or unresponsive.<\/li>\n\n\n\n<li><strong>Uncertainty: <\/strong>&nbsp;A delay without feedback can make users second-guess their actions: Did I click that button? Is the page stuck?<\/li>\n\n\n\n<li><strong>Poor Accessibility: <\/strong>Screen readers may have nothing to announce, making the experience confusing for assistive technologies.<\/li>\n\n\n\n<li><strong>Debugging Pain:<\/strong> If something silently fails, users and even developers might miss it entirely.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>How Placeholders &amp; States Help<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Placeholder<\/strong><\/h4>\n\n\n\n<p>@placeholder lets you show temporary content while the real component is being loaded. This can be a spinner, image, skeleton UI, or anything that makes the wait feel intentional and expected. The @placeholder block also lets you set a minimum time it should stay visible, using the minimum parameter (like 500ms or 2s). This helps prevent a flicker effect when the deferred content loads too quickly. The timer starts right after the placeholder finishes rendering.<\/p>\n\n\n\n<p>For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-heavy-widget<\/span> \/&gt;<\/span>\n\n} @placeholder (minimum 1s) {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>Loading...<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Even if the widget loads instantly, the placeholder will stay for at least 1 second to keep the UI smooth and contribute to angular performance optimization.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Loading<\/strong><\/h4>\n\n\n\n<p>@loading provides a hook for when the defer block has started fetching but isn\u2019t ready yet. This is especially helpful for async operations like Angular lazy loading of modules or data. The @loading block also accepts two optional parameters to specify the minimum amount of time that this placeholder should be shown and the amount of time to wait after loading begins before showing the loading template. The purpose of these params is the same as placeholders, to prevent flicker effects. Both the minimum and after timers for the @loading block begin immediately after the loading has been triggered.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Error<\/strong><\/h4>\n\n\n\n<p>@error gives you a graceful fallback if the deferred component fails to load, whether due to a network issue, module resolution error, or some other problem. This enhances core web vitals in Angular by preventing bad user experiences due to invisible failures.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (on timer(2s)) {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-heavy-widget<\/span> \/&gt;<\/span>\n\n} @placeholder {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"skeleton\"<\/span>&gt;<\/span>Loading widget...<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n} @loading {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"spinner\"<\/span>&gt;<\/span>Almost there...<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n} @error {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"error\"<\/span>&gt;<\/span>Oops! Couldn\u2019t load the widget.<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>With these features in place, your app stays informative, accessible, and polished, even when deferring content behind the scenes. This supports both UX and deferred loading in Angular.<\/p>\n\n\n\n<p><em>Another example below:<\/em><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (on interaction) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">analytics-widget<\/span> \/&gt;<\/span>\n\n&nbsp;&nbsp;} @placeholder {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>Widget Placeholder<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Hereby default, the placeholder will act as the interaction element as long as it is a single root element node.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>This is a single root element<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@placeholder {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span>&gt;<\/span>Click to load chart<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li>Multiple elements, not a single root<\/li>\n<\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@placeholder {\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>Chart coming soon<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span>&gt;<\/span>Load<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Alternatively, you can specify a template reference variable as the element that triggers interaction. This variable is passed in as a parameter on the interaction trigger.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"button\"<\/span> #<span class=\"hljs-attr\">trigger<\/span>&gt;<\/span>View Charts<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n\n\n@defer (on interaction(trigger)) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-product-charts<\/span> \/&gt;<\/span>\n\n&nbsp;&nbsp;} @placeholder {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>Product Charts<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h4 class=\"wp-block-heading\"><strong>Few other options:<\/strong><\/h4>\n\n\n\n<h5 class=\"wp-block-heading inner-h5\"><strong>on hover<\/strong><\/h5>\n\n\n\n<p>Hover triggers deferred loading when the mouse has hovered over the trigger area. Events used for this are mouseenter and focus.<\/p>\n\n\n\n<h5 class=\"wp-block-heading inner-h5\"><strong>on immediate<\/strong><\/h5>\n\n\n\n<p>Immediate triggers the deferred load once the client has finished rendering, the deferred chunk would then start fetching right away, supporting Angular rendering strategies.<\/p>\n\n\n\n<p>You could also use multiple conditions together in one statement, and the swap will be triggered if either condition is met.<\/p>\n\n\n\n<p>For Example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer(on viewport; when condition) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-heavy-widget<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">app-heavy-widget<\/span>&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\"><strong>Hands-on Example: Just Copy and See It Work!<\/strong><\/h2>\n\n\n\n<p>Please take the below example and simply copy-paste it into any component\u2019s HTML file in your Angular 19 project.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No changes in .ts files,<\/li>\n\n\n\n<li>No services,<\/li>\n\n\n\n<li>No special setup.<\/li>\n<\/ul>\n\n\n\n<p>That&#8217;s how easy it is to use @defer (when viewport) in Angular for template-level performance optimization!<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"container\"<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"card\"<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"height: 400px;\"<\/span>&gt;<\/span>\n    @defer (on timer(3000)){\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"deferred-view\"<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"background: #a4daa4; padding: 20px; border-radius: 6px;\"<\/span>&gt;<\/span>\n\n\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"card-header\"<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Congratulations!<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"card-body\"<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n          <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>Hey, you successfully completed the test!<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n          Your efforts are appreciated. Keep up the great work.\n\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n          We hope you enjoyed the challenge and learned something new. Stay tuned for more exciting content!\n\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">span<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"btn btn-primary\"<\/span>&gt;<\/span>Thank you!<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">span<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n    }\n\n    @placeholder {\n\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"loading-placeholder\"<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"height: 100px; background: #d3e59d; padding: 20px; border-radius: 6px;\"<\/span>&gt;<\/span>\n\n      <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">p<\/span>&gt;<\/span>Loading content...<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">p<\/span>&gt;<\/span>\n\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n    }\n\n    @error {\n\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"error-message\"<\/span>&gt;<\/span>\n\n      Something went wrong while loading your content. Please try again later.\n\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\n    }\n\n  <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n  \n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If you did it successfully, you&#8217;ll see the card content appearing as soon as it scrolls into view. Congratulations! You&#8217;ve just done a hands-on experiment with Angular\u2019s @defer feature. You now understand how viewport-based deferred loading in Angular works in a real Angular 19 project.<\/p>\n\n\n\n<p>Now that you\u2019ve successfully seen it in action, feel free to experiment with it further!<\/p>\n\n\n\n<p>If you&#8217;d like to clearly observe the transition in real time, try replacing on viewport with on timer(3000).<\/p>\n\n\n\n<p>This gives you enough time to scroll to the component or switch back to your browser tab, and you\u2019ll see the content fade in right before your eyes.<\/p>\n\n\n\n<p>Here\u2019s the result of the @defer in action<br>Watch how the content smoothly appears in the view:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>GIF Demo Below<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><noscript><img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-demo-viewport-interaction.gif\" alt=\"Angular defer block demo showing conditional and lazy rendering\" class=\"wp-image-38462\" title=\"Demo of Angular @defer in action with interaction and viewport triggers\"><\/noscript><img decoding=\"async\" width=\"800\" height=\"450\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20450%22%3E%3C%2Fsvg%3E\" alt=\"Angular defer block demo showing conditional and lazy rendering\" class=\"wp-image-38462 lazyload\" title=\"Demo of Angular @defer in action with interaction and viewport triggers\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-demo-viewport-interaction.gif\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Prefetching: Get Ready Before the User Is<\/strong><\/h2>\n\n\n\n<p>@defer also supports Angular defer prefetching, which means you can load the required resources before the user triggers the view.<\/p>\n\n\n\n<p>You can use the prefetch keyword along with on or when conditions to control when Angular should start fetching the dependencies, separately from when it renders the component. This is super useful for Angular performance optimization and improving perceived performance. For example, you can start fetching the data when the browser is idle, and render it only when the user interacts:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-14\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\">@defer (on interaction; prefetch on idle) {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">app-data-table<\/span> \/&gt;<\/span>\n\n} @placeholder {\n\n&nbsp;&nbsp;<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">img<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"placeholder.png\"<\/span> \/&gt;<\/span>\n\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-14\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here, the browser begins downloading the necessary resources in the background when it&#8217;s idle, so when the user finally interacts, everything is already in place, making the UI feel instant and smooth. This technique aligns well with modern rendering strategies and helps improve core web vitals in Angular applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Behavior with SSR and NgModules<\/strong><\/h2>\n\n\n\n<p>When using @defer with Server-Side Rendering (SSR) or Static Site Generation (SSG), only the @placeholder content is rendered. Any triggers are ignored during server render. So, make sure your placeholder is meaningful for the first load!&nbsp;<\/p>\n\n\n\n<p>To dive deeper into setting up <a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/angular-19-ssr-guide-angular-universal-setup\">Angular Universal<\/a> for SSR, check out our<a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/angular-signals-architecture-best-practices\"> Complete Guide to SSR with Angular 19 \u2013 Angular Universal Setup<\/a>.\u201d<\/p>\n\n\n\n<p>Also, @defer works with both Angular standalone components and NgModule-based components, directives, and pipes. However, only standalone ones can be truly deferred. NgModule-based dependencies will still be bundled and loaded eagerly, which may impact bundle splitting and initial load performance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Do\u2019s and Don\u2019ts with @defer<\/strong><\/h3>\n\n\n\n<p><strong>Do:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use for heavy, non-essential components (e.g., widgets, charts, ads, analytics)<\/li>\n\n\n\n<li>Defer offscreen content (below the fold) or not immediately needed<\/li>\n\n\n\n<li>Use meaningful placeholders and triggers for better UX<\/li>\n\n\n\n<li>Adjust nested @defer conditions to avoid multiple loads firing at once<\/li>\n<\/ul>\n\n\n\n<p><strong>Don\u2019t:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Defer critical UI like login forms, primary buttons, or anything users need instantly<\/li>\n\n\n\n<li>Trigger deferred blocks too early (e.g., with immediate or timer) for content in the initial viewport<\/li>\n\n\n\n<li>Use the same trigger for nested @defer blocks, and avoid cascading requests<\/li>\n\n\n\n<li>Leave placeholders blank: missing feedback can confuse users and harm perceived performance<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;If you&#8217;re exploring modern reactivity in Angular beyond @defer, check out our<a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/angular-signals-architecture-best-practices\"> <strong>Angular Signals Guide: Patterns &amp; Best Practices<\/strong><\/a> to see how Signals integrate with component rendering and change detection.\u201d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Performance Gains: Why Use Deferred Views?<\/strong><\/h2>\n\n\n\n<p>Using @defer isn&#8217;t just about loading less, it\u2019s about loading smart. Here\u2019s how deferred views in Angular boost your app&#8217;s performance and user experience:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Improve Core Web Vitals like LCP (Largest Contentful Paint) and FCP by reducing the amount of content rendered upfront. Less blocking, faster visual feedback.<\/li>\n\n\n\n<li>Minimize the DOM size on first paint, helping the browser do less work and render the initial screen more quickly.<\/li>\n\n\n\n<li>Delay heavy components that don&#8217;t need to run immediately (like charts, calendars, or widgets), saving memory and processing power.<\/li>\n\n\n\n<li>Boost user experience on slower networks or low-powered devices by prioritizing what matters first and loading the rest only when needed.<\/li>\n\n\n\n<li>And the best part? It\u2019s declarative, clean, and fits seamlessly into the modern Angular ecosystem, especially with Angular standalone components.<\/li>\n<\/ul>\n\n\n\n<p>When combined with<a href=\"https:\/\/mobisoftinfotech.com\/services\/devops\"> <strong>devops or CI\/CD for angular apps<\/strong><\/a>, these performance techniques help automate and streamline delivery pipelines efficiently.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Wrap-Up: Smarter Renders, Faster Loads<\/strong><\/h2>\n\n\n\n<p>Angular\u2019s @defer syntax marks a shift in how we think about rendering and performance. It\u2019s simple, powerful, and tailor-made for modern apps that need speed and flexibility.<\/p>\n\n\n\n<p>With deferred views, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Render smarter, not harder<\/li>\n\n\n\n<li>Speed up initial loads<\/li>\n\n\n\n<li>Delight users with faster and more responsive interfaces<\/li>\n<\/ul>\n\n\n\n<p>Start using @defer today in Angular and transform your app&#8217;s performance without the headache.If you have any queries, please check out the official<a href=\"https:\/\/v17.angular.io\/guide\/defer\"> Angular docs<\/a> or hit me up on<a href=\"https:\/\/www.linkedin.com\/in\/rohit-kumar-454a221aa?\"> LinkedIn<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/mobisoftinfotech.com\/contact-us?utm_source=blog_cta&#038;utm_campaign=angular-performance-defer-tutorial-cta2\"><noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-scalable-apps.png\" alt=\"Build scalable Angular apps using optimized rendering and lazy loading\" class=\"wp-image-38464\" title=\"Build Your Next Big Idea with Scalable Angular Solutions\"><\/noscript><img decoding=\"async\" width=\"855\" height=\"363\" src=\"data:image\/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20855%20363%22%3E%3C%2Fsvg%3E\" alt=\"Build scalable Angular apps using optimized rendering and lazy loading\" class=\"wp-image-38464 lazyload\" title=\"Build Your Next Big Idea with Scalable Angular Solutions\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-scalable-apps.png\"><\/a><\/figure>\n\n\n<div class=\"related-posts-section\"><h2>Related Posts<\/h2><ul class=\"related-posts-list\"><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/scalable-web-application-development-leadership-decision\">Web Application Development for Scale Is a Leadership Decision, Not a Technical One<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/opentelemetry-java-spring-boot-integration\">OpenTelemetry Java Tutorial: Integrating OpenTelemetry in Your Spring Boot Application<\/a><\/li><li><a href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/react-admin-dashboard-supabase-tutorial\">Build a React Admin Dashboard with Supabase Integration \u2013 Full Tutorial<\/a><\/li><\/ul><\/div>\n\n\n<div class=\"modern-author-card\">\n    <div class=\"author-card-content\">\n        <div class=\"author-info-section\">\n            <div class=\"author-avatar\">\n                <noscript><img decoding=\"async\" src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/author-rohit-kumar-angular-performance-tutorial-blog.png\" alt=\"Rohit Kumar\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"Rohit Kumar\" data-src=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/author-rohit-kumar-angular-performance-tutorial-blog.png\" class=\" lazyload\">\n            <\/div>\n            <div class=\"author-details\">\n                <h3 class=\"author-name\">Rohit Kumar<\/h3>\n                <p class=\"author-title\">Frontend Developer<\/p>\n                <a href=\"javascript:void(0);\" class=\"read-more-link read-more-btn\" onclick=\"toggleAuthorBio(this); return false;\">Read more <noscript><img decoding=\"async\" src=\"\/assets\/images\/blog\/Vector.png\" alt=\"expand\" class=\"read-more-arrow down-arrow\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"expand\" class=\"read-more-arrow down-arrow lazyload\" data-src=\"\/assets\/images\/blog\/Vector.png\"><\/a>\n                <div class=\"author-bio-expanded\">\n                    <p>Rohit Kumar is a frontend developer at <a href=\"https:\/\/mobisoftinfotech.com\">Mobisoft Infotech<\/a> with around four years of experience in building responsive, performance-focused web applications. With strong expertise in Angular and working knowledge of Node.js, he is passionate about crafting smooth user experiences and writing clean, scalable code. Rohit is especially driven by frontend performance, precise UI implementation, and solving real-world challenges through thoughtful design and development.<\/p>\n                    <div class=\"author-social-links\"><div class=\"social-icon\"><a href=\"https:\/\/www.linkedin.com\/in\/rohit-kumar-454a221aa\/\" target=\"_blank\" rel=\"nofollow noopener\"><i class=\"icon-sprite linkedin\"><\/i><\/a><\/div><\/div>\n                    <a href=\"javascript:void(0);\" class=\"read-more-link read-less-btn\" onclick=\"toggleAuthorBio(this); return false;\" style=\"display: none;\">Read less <noscript><img decoding=\"async\" src=\"\/assets\/images\/blog\/Vector.png\" alt=\"collapse\" class=\"read-more-arrow up-arrow\"><\/noscript><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODlhAQABAIAAAAAAAP\/\/\/yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" alt=\"collapse\" class=\"read-more-arrow up-arrow lazyload\" data-src=\"\/assets\/images\/blog\/Vector.png\"><\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n        <div class=\"share-section\">\n            <span class=\"share-label\">Share Article<\/span>\n            <div class=\"social-share-buttons\">\n                <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fmobisoftinfotech.com%2Fresources%2Fblog%2Fweb-development%2Fangular-performance-defer-tutorial\" target=\"_blank\" class=\"share-btn facebook-share\"><i class=\"fa fa-facebook-f\"><\/i><\/a>\n                <a href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fmobisoftinfotech.com%2Fresources%2Fblog%2Fweb-development%2Fangular-performance-defer-tutorial\" target=\"_blank\" class=\"share-btn linkedin-share\"><i class=\"fa fa-linkedin\"><\/i><\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n\n\n<style>\nspan.hljs-name {\n    font-weight: normal;\n}\nh5.wp-block-heading.inner-h5 {\n    position: relative;\n    padding-left: 20px;\n}\n\nh5.wp-block-heading.inner-h5:before {\n    content: '';\n    width: 9px;\n    height: 9px;\n    background-color: #0d265c;\n    border-radius: 50%;\n    position: absolute;\n    left: 0;\n    top: 8px;\n}\n.hljs-selector-tag {\n    font-weight: normal;\n}\n\n.hljs-keyword {\n    font-weight: normal;\n}\n\n.hljs-attribute {\n    font-weight: normal;\n}\n.post-content h4 {\n    font-size: 22px;\n}\n.post-content h5{\n   font-size: 20px;\n}\n@media only screen and (max-width: 991px) {\n    .post-content li {\n       padding-left: 25px;\n    }\n    .post-content li:before {\n        content: '';\n         width: 9px;\n        height: 9px;\n        background-color: #0d265c;\n        border-radius: 50%;\n        position: absolute;\n        left: 0px;\n        top: 12px;\n    }\n}\n<\/style>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Article\",\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\"\n  },\n  \"headline\": \"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer\",\n  \"description\": \"Learn to build a React file uploader component with a progress bar using TypeScript and NodeJS. Supports multiple file uploads and real-time progress.\",\n  \"image\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\n  \"author\": {\n    \"@type\": \"Person\",\n    \"name\": \"Rohit Kumar\",\n    \"description\": \"Rohit Kumar is a frontend developer at Mobisoft Infotech with around four years of experience in building responsive, performance-focused web applications. With strong expertise in Angular and working knowledge of Node.js, he is passionate about crafting smooth user experiences and writing clean, scalable code. Rohit is especially driven by frontend performance, precise UI implementation, and solving real-world challenges through thoughtful design and development.\"\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"Mobisoft Infotech\",\n    \"logo\": {\n      \"@type\": \"ImageObject\",\n      \"url\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/mshomepage\/MI_Logo-white.svg\",\n      \"width\": 600,\n      \"height\": 600\n    }\n  },\n  \"datePublished\": \"2025-05-12\",\n  \"dateModified\": \"2025-05-12\"\n}\n<\/script>\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"Organization\",\n  \"name\": \"Mobisoft Infotech\",\n  \"url\": \"https:\/\/mobisoftinfotech.com\/\",\n  \"logo\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/MI_Logo.svg\",\n  \"sameAs\": [\n    \"https:\/\/www.facebook.com\/pages\/Mobisoft-Infotech\/131035500270720\",\n    \"https:\/\/twitter.com\/MobisoftInfo\",\n    \"https:\/\/www.instagram.com\/mobisoftinfotech\/\",\n    \"https:\/\/www.youtube.com\/channel\/UCtwuTXKUXFX7k0NSYhsMeTg\",\n    \"https:\/\/www.linkedin.com\/company\/mobisoft-infotech\",\n    \"https:\/\/in.pinterest.com\/mobisoftinfotech\/\",\n    \"https:\/\/github.com\/MobisoftInfotech\"\n  ],\n  \"contactPoint\": [\n    {\n      \"@type\": \"ContactPoint\",\n      \"telephone\": \"+1-855-572-2777\",\n      \"contactType\": \"Customer Service\",\n      \"areaServed\": \"US\",\n      \"availableLanguage\": [\"English\"]\n    },\n    {\n      \"@type\": \"ContactPoint\",\n      \"telephone\": \"+91-858-600-8627\",\n      \"contactType\": \"Customer Service\",\n      \"areaServed\": \"IN\",\n      \"availableLanguage\": [\"English\"]\n    }\n  ]\n}\n<\/script>\n<script type=\"application\/ld+json\">\n{\n    \"@context\": \"https:\/\/schema.org\",\n    \"@type\": \"LocalBusiness\",\n    \"name\": \"Mobisoft Infotech\",\n    \"url\": \"https:\/\/mobisoftinfotech.com\",\n    \"logo\": \"https:\/\/mobisoftinfotech.com\/assets\/images\/mshomepage\/MI_Logo-white.svg\",\n    \"description\": \"Mobisoft Infotech specializes in custom software development and digital solutions.\",\n    \"address\": {\n        \"@type\": \"PostalAddress\",\n        \"streetAddress\": \"5718 Westheimer Rd Suite 1000\",\n        \"addressLocality\": \"Houston\",\n        \"addressRegion\": \"TX\",\n        \"postalCode\": \"77057\",\n        \"addressCountry\": \"USA\"\n    },\n    \"contactPoint\": [{\n        \"@type\": \"ContactPoint\",\n        \"telephone\": \"+1-855-572-2777\",\n        \"contactType\": \"Customer Service\",\n        \"areaServed\": [\"USA\", \"Worldwide\"],\n        \"availableLanguage\": [\"English\"]\n    }],\n    \"sameAs\": [\n        \"https:\/\/www.facebook.com\/pages\/Mobisoft-Infotech\/131035500270720\",\n        \"https:\/\/x.com\/MobisoftInfo\",\n        \"https:\/\/www.linkedin.com\/company\/mobisoft-infotech\",\n        \"https:\/\/in.pinterest.com\/mobisoftinfotech\/\",\n        \"https:\/\/www.instagram.com\/mobisoftinfotech\/\",\n        \"https:\/\/github.com\/MobisoftInfotech\",\n        \"https:\/\/www.behance.net\/MobisoftInfotech\",\n        \"https:\/\/www.youtube.com\/channel\/UCtwuTXKUXFX7k0NSYhsMeTg\"\n    ]\n}\n<\/script>\n<script type=\"application\/ld+json\">\n    [\n    {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \" Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer\",\n            \"caption\": \"A complete Angular tutorial showing how to optimize rendering performance using @defer\",\n            \"description\": \"Banner image for the blog Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer, covering Angular lazy loading, template optimization, and deferred rendering strategies.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-placeholder.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \"Enhance UX in Angular with @placeholder, @loading, and @error blocks\",\n            \"caption\": \"Improve user experience in Angular apps using @defer sub-blocks for loading and error handling\",\n            \"description\": \"Visual representation of how Angular @defer integrates with @placeholder, @loading, and @error blocks to support user feedback and Angular performance optimization.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-placeholder.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-demo-viewport-interaction.gif\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \"Demo of Angular @defer in action with interaction and viewport triggers\",\n            \"caption\": \"Live demo of Angular defer block with various triggers like interaction and timer\",\n            \"description\": \"Visual demo used in the Angular tutorial showcasing @defer syntax and how deferred views are rendered on user interaction, scroll, or idle conditions for better performance.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-defer-demo-viewport-interaction.gif\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/hire-angular-developer-performance.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \"Power Your Applications with Expert Angular Developers\",\n            \"caption\": \"Unlock performance with the right Angular development partner\",\n            \"description\": \"Call to action image encouraging companies to Hire Angular Developer for performance-optimized Angular apps using the latest features like @defer and standalone components.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/hire-angular-developer-performance.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-scalable-apps.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \"Build Your Next Big Idea with Scalable Angular Solutions\",\n            \"caption\": \"From idea to deployment\u2014leverage Angular\u2019s power with the right tech team\",\n            \"description\": \"Promotional call-to-action focused on Angular app development, highlighting the role of performance techniques like deferred views, CI\/CD for Angular apps, and Angular lazy loading in delivering scalable digital products.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-scalable-apps.png\"\n        },\n        {\n            \"@context\": \"https:\/\/schema.org\",\n            \"@type\": \"ImageObject\",\n            \"contentUrl\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/author-rohit-kumar-angular-performance-tutorial-blog.png\",\n            \"url\": \"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\n            \"name\": \"Meet the Author: Rohit Kumar - Angular Performance Expert\",\n            \"caption\": \"Written by Rohit Kumar, an expert on Angular performance and deferred views optimization\",\n            \"description\": \"Author image for the blog post Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer, authored by Rohit Kumar, focused on Angular rendering strategies, performance optimization, and improving user experience.\",\n            \"license\": \"https:\/\/mobisoftinfotech.com\/terms\",\n            \"acquireLicensePage\": \"https:\/\/mobisoftinfotech.com\/acquire-license\",\n            \"creditText\": \"Mobisoft Infotech\",\n            \"copyrightNotice\": \"Mobisoft Infotech\",\n            \"creator\": {\n                \"@type\": \"Organization\",\n                \"name\": \"Mobisoft Infotech\"\n            },\n            \"thumbnail\": \"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/author-rohit-kumar-angular-performance-tutorial-blog.png\"\n        }\n        ]\n    <\/script>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever built a dashboard that feels slow or unresponsive right after loading? Or a page that tries to load everything at once, even parts the user hasn\u2019t even scrolled to yet? As Angular apps grow, so does the initial rendering cost, which can make the app feel sluggish. While Angular has always offered [&hellip;]<\/p>\n","protected":false},"author":111,"featured_media":38460,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[5551],"tags":[5537,5532,5538,5539,5540,5536,5534,5541,5552,5543,5544,5531,5533,5545,5535,5546,5547,5548,5549,5550,5530],"class_list":["post-38452","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-defer-syntax-angular","tag-angular-defer","tag-angular-error-block","tag-angular-loading-block","tag-angular-placeholder-block","tag-angular-bundle-splitting-interaction","tag-angular-defer-block","tag-angular-defer-prefetching","tag-angular-defer-triggers","tag-angular-defer-with-ngmodule","tag-angular-defer-with-standalone-components","tag-angular-lazy-loading","tag-angular-performance-optimization","tag-angular-rendering-strategies","tag-angular-standalone-components","tag-angular-template-optimization","tag-core-web-vitals-angular","tag-deferred-loading-in-angular","tag-improving-lcp-with-angular","tag-reducing-ttfb-in-angular","tag-viewport"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Angular Tutorial: Optimise Performance with @defer<\/title>\n<meta name=\"description\" content=\"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular Tutorial: Optimise Performance with @defer\" \/>\n<meta property=\"og:description\" content=\"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\" \/>\n<meta property=\"og:site_name\" content=\"Mobisoft Infotech\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-12T12:19:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-20T05:36:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/og-Angular-Tutorial.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rohit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rohit Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\"},\"author\":{\"name\":\"Rohit Kumar\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f\"},\"headline\":\"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer\",\"datePublished\":\"2025-05-12T12:19:23+00:00\",\"dateModified\":\"2025-11-20T05:36:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\"},\"wordCount\":1994,\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\"keywords\":[\"@defer syntax angular\",\"angular @defer\",\"angular @error block\",\"angular @loading block\",\"angular @placeholder block\",\"angular bundle splitting interaction\",\"angular defer block\",\"angular defer prefetching\",\"angular defer triggers\",\"angular defer with ngmodule\",\"angular defer with standalone components\",\"angular lazy loading\",\"angular performance optimization\",\"angular rendering strategies\",\"angular standalone components\",\"angular template optimization\",\"core web vitals angular\",\"deferred loading in angular\",\"improving lcp with angular\",\"reducing ttfb in angular\",\"viewport\"],\"articleSection\":[\"Web Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\",\"name\":\"Angular Tutorial: Optimise Performance with @defer\",\"isPartOf\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\"datePublished\":\"2025-05-12T12:19:23+00:00\",\"dateModified\":\"2025-11-20T05:36:37+00:00\",\"author\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f\"},\"description\":\"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.\",\"breadcrumb\":{\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\"contentUrl\":\"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png\",\"width\":855,\"height\":392,\"caption\":\"Deferred loading in Angular using placeholders loading and error blocks\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mobisoftinfotech.com\/resources\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#website\",\"url\":\"https:\/\/mobisoftinfotech.com\/resources\/\",\"name\":\"Mobisoft Infotech\",\"description\":\"Discover Mobility\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f\",\"name\":\"Rohit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g\",\"caption\":\"Rohit Kumar\"},\"sameAs\":[\"https:\/\/mobisoftinfotech.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular Tutorial: Optimise Performance with @defer","description":"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial","og_locale":"en_US","og_type":"article","og_title":"Angular Tutorial: Optimise Performance with @defer","og_description":"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.","og_url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial","og_site_name":"Mobisoft Infotech","article_published_time":"2025-05-12T12:19:23+00:00","article_modified_time":"2025-11-20T05:36:37+00:00","og_image":[{"width":1000,"height":525,"url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/og-Angular-Tutorial.png","type":"image\/png"}],"author":"Rohit Kumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rohit Kumar","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#article","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial"},"author":{"name":"Rohit Kumar","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f"},"headline":"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer","datePublished":"2025-05-12T12:19:23+00:00","dateModified":"2025-11-20T05:36:37+00:00","mainEntityOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial"},"wordCount":1994,"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png","keywords":["@defer syntax angular","angular @defer","angular @error block","angular @loading block","angular @placeholder block","angular bundle splitting interaction","angular defer block","angular defer prefetching","angular defer triggers","angular defer with ngmodule","angular defer with standalone components","angular lazy loading","angular performance optimization","angular rendering strategies","angular standalone components","angular template optimization","core web vitals angular","deferred loading in angular","improving lcp with angular","reducing ttfb in angular","viewport"],"articleSection":["Web Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial","url":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial","name":"Angular Tutorial: Optimise Performance with @defer","isPartOf":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage"},"image":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png","datePublished":"2025-05-12T12:19:23+00:00","dateModified":"2025-11-20T05:36:37+00:00","author":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f"},"description":"Boost Angular performance using @defer blocks and deferred views. Learn how to improve LCP, reduce TTFB, and optimize rendering with smart loading.","breadcrumb":{"@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#primaryimage","url":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png","contentUrl":"https:\/\/mobisoftinfotech.com\/resources\/wp-content\/uploads\/2025\/05\/angular-performance-defer-tutorial.png","width":855,"height":392,"caption":"Deferred loading in Angular using placeholders loading and error blocks"},{"@type":"BreadcrumbList","@id":"https:\/\/mobisoftinfotech.com\/resources\/blog\/web-development\/angular-performance-defer-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mobisoftinfotech.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Angular Tutorial: Optimise Performance Using Deferred Views In Angular Using @defer"}]},{"@type":"WebSite","@id":"https:\/\/mobisoftinfotech.com\/resources\/#website","url":"https:\/\/mobisoftinfotech.com\/resources\/","name":"Mobisoft Infotech","description":"Discover Mobility","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mobisoftinfotech.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mobisoftinfotech.com\/resources\/#\/schema\/person\/87d799b17417da4cc5673e6a12b6890f","name":"Rohit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e0e3631c78413967dd98377fe4dc94d791178b815b26d55fab4303ed43ea5b1?s=96&r=g","caption":"Rohit Kumar"},"sameAs":["https:\/\/mobisoftinfotech.com\/"]}]}},"_links":{"self":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/38452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/users\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/comments?post=38452"}],"version-history":[{"count":23,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/38452\/revisions"}],"predecessor-version":[{"id":45409,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/posts\/38452\/revisions\/45409"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media\/38460"}],"wp:attachment":[{"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/media?parent=38452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/categories?post=38452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mobisoftinfotech.com\/resources\/wp-json\/wp\/v2\/tags?post=38452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}