{"id":1435,"date":"2024-02-16T00:00:00","date_gmt":"2024-02-15T23:00:00","guid":{"rendered":"https:\/\/demo.sidekick.be\/itenium\/angular17\/"},"modified":"2025-11-28T13:31:42","modified_gmt":"2025-11-28T12:31:42","slug":"angular17","status":"publish","type":"post","link":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/","title":{"rendered":"Angular 17 &#8211; What&#8217;s new?"},"content":{"rendered":"<p>and so much more as you can see in <a href=\"https:\/\/github.com\/angular\/angular\/blob\/main\/CHANGELOG.md#1700-2023-11-08\">the release notes<\/a>.<br \/> But I\u2019d like to dive into some that offer quite the Quality of Life improvements<\/p>\n<h1 id=\"built-in-control-flow\">Built-in control flow<\/h1>\n<p>Before Angular 17 we\u2019ve always used <code>*ngIf, *ngSwitch, and *ngFor<\/code>, but now there\u2019s a new block template syntax in preview which feels a lot more intuitive, requires no special imports and has better type checking thanks to its improved type narrowing.<\/p>\n<p>You can automatically migrate existing project with <code>ng generate @angular\/core:control-flow<\/code><\/p>\n<h2 id=\"ifelse-and-even-else-if\">If\/else and even else if!<\/h2>\n<p>Traditionally we\u2019d do<\/p>\n<pre><code class=\"language-html\">&lt;div *ngIf=\"usingLatest; else outdated\"&gt;\n   You\u2019re using the latest version. \n&lt;\/div&gt; \n&lt;ng-template #outdated&gt;\n   You are using an outdated version \n&lt;\/ng-template&gt;\n<\/code><\/pre>\n<p>Now we can do<\/p>\n<pre><code class=\"language-js\">@if (usingLatest) {\n  Thank you for using the latest version\n} @else {\n  You are using an outdated version\n}\n<\/code><\/pre>\n<p>This construction also allows us to write an if\/else if\/else construction which formerly wasn\u2019t possible.<\/p>\n<h2 id=\"iteration\">Iteration<\/h2>\n<p>To loop over a list of elements we\u2019d perform<\/p>\n<pre><code class=\"language-html\">&lt;div *ngFor=\"let angularRelease of angularReleases\"&gt;\n  Release: {{ angularRelease.versionNumber }} - Date: {{ angularRelease.date }} &lt;br&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p>With <strong>optionally<\/strong> a <code>trackBy<\/code> function. In the new approach, <code>track<\/code> is mandatory. The new for statement uses a new diffing algorithm which is quite a bit faster according to <a href=\"https:\/\/krausest.github.io\/js-framework-benchmark\/current.html\"><strong>community framework benchmarks<\/strong><\/a>.<br \/> It\u2019s also quite easy to add an empty placeholder.<\/p>\n<pre><code class=\"language-js\">@for (angularRelease of angularReleases; track angularRelease.versionNumber) {\n  Release: {{ angularRelease.versionNumber }} - Date: {{ angularRelease.date }} &lt;br&gt;\n} @empty {\n  Empty list of releases\n}\n<\/code><\/pre>\n<h2 id=\"switches\">Switches<\/h2>\n<p>Switches have also become quite a lot more convenient, from:<\/p>\n<pre><code class=\"language-html\">&lt;div [ngSwitch]=\"roll\"&gt;\n  &lt;app-one *ngSwitchCase=\"1\"\/&gt;\n  &lt;app-two *ngSwitchCase=\"2\"\/&gt;\n  &lt;app-three *ngSwitchDefault\/&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n<p>To<\/p>\n<pre><code class=\"language-js\">@switch (roll) {\n  @case (1) { &lt;app-one\/&gt; }\n  @case (2) { &lt;app-two\/&gt; }\n  @default { &lt;app-three\/&gt; }\n}\n<\/code><\/pre>\n<h1 id=\"deferrable-views\">Deferrable views<\/h1>\n<p>This is the planned roads forwards for lazy loading. It utilizes the new block mechanism for <strong>standalone<\/strong> components to make our applications faster, by as the name implies easily facilitating declarative, deferred loading. One of the nice things about this, is that this all also happens at compile-time, all the complexity is abstracted away.<\/p>\n<p>Let\u2019s use this example:<\/p>\n<pre><code class=\"language-js\">@defer (on hover) {\n  &lt;app-heavy\/&gt;\n} @loading {\n  Loading\u2026\n} @error {\n  Loading failed\n} @placeholder (minimum 2000ms) {\n  &lt;div&gt;Placeholder that will be shown for 2000ms minimally (to prevent flickering in case the deferred component loads quickly)&lt;\/div&gt;\n}\n<\/code><\/pre>\n<p>In this example, we\u2019re deferring the loading of a heavy component, until the block\u2019s been hovered over. In the interim we\u2019ll be showcasing the placeholder (and in this case, minimally for 2 seconds). After which we\u2019ll see either the loading in case it takes long\/the result\/loading failed in case of an error.<\/p>\n<p>Only <code>@defer<\/code> is required, <code>@loading | @error | @placeholder<\/code> are all optional.<\/p>\n<p>There possible triggers are:<\/p>\n<ul>\n<li>on idle =&gt; there default, triggers loading once the browser has reached an idle state<\/li>\n<li>on viewport =&gt; when the specified content enters the viewport<\/li>\n<li>on hover =&gt; when the user hovers over the trigger area<\/li>\n<li>on interact =&gt; when the user interacts with the specified element<\/li>\n<li>on immediate =&gt; triggered once the client has finished rendering<\/li>\n<li>on timer =&gt; delays the loading with a timer<\/li>\n<\/ul>\n<p>Another nice thing is that deferrable views also allow us the option to prefetch dependencies before rendering them. This can be done by adding a <code>prefetch<\/code> to the defer block (the same triggers as above are supported).<\/p>\n<p><code>@defer (on viewport; prefetch on idle) {...}<\/code><\/p>\n<h1>Extras<\/h1>\n<p><b>Other interesting reads<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.angular.io\/introducing-angular-v17-4d7033312e4b\">Blog post: Introducing Angular v17<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/angular\/angular\/blob\/main\/CHANGELOG.md#1700-2023-11-08\">Official Release Notes<\/a><\/li>\n<\/ul>\n<h1> Package Versions <i class=\"fa fa-info-circle\" style=\"float: right; color: cornflowerblue; font-size: 28px\" title=\"Package versions used for this post and in the accompanying code on Github\"><\/i><\/h1>\n<div><a href=\"https:\/\/github.com\/angular\/angular\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/angular\/angular.svg?style=social&#038;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/angular\/angular\">angular\/angular<\/a>: v17 <\/div>\n","protected":false},"excerpt":{"rendered":"<blockquote>\n<p>Angular 17 has landed with a rebranding, and an <a href=\"https:\/\/angular.dev\/\">a new documentation home<\/a> which now also offers an interactive learning experience, but what else is new?<\/p>\n<\/blockquote>\n<p>There are a plethora of improvements such as:<\/p>\n<ul>\n<li>hydration graduated from developer preview<\/li>\n<li>standalone APIs is now the default<\/li>\n<li>new @angular\/ssr package<\/li>\n<li>improved SSR functionality<\/li>\n<li>the Signals API is mostly out of developer preview (effect() remains in it)<\/li>\n<li>new <code>afterRender<\/code> and <code>afterNextRender<\/code> lifecycle hooks<\/li>\n<li>Vite &amp; esbuild are now the default for new projects<\/li>\n<li>experimental view transition support<\/li>\n<li>automatic preconnect in the image directive<\/li>\n<li>defer loading of the animations module<\/li>\n<li>style and styleUrls as strings<\/li>\n<li>\u2026<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":2003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[3],"tags":[23],"class_list":["post-1435","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-angular"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Angular 17 - What&#039;s new? - Itenium<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Angular 17 - What&#039;s new? - Itenium\" \/>\n<meta property=\"og:description\" content=\"Angular 17 has landed with a rebranding, and an a new documentation home which now also offers an interactive learning experience, but what else is new?There are a plethora of improvements such as:hydration graduated from developer previewstandalone APIs is now the defaultnew @angular\/ssr packageimproved SSR functionalitythe Signals API is mostly out of developer preview (effect() remains in it)new afterRender and afterNextRender lifecycle hooksVite &amp; esbuild are now the default for new projectsexperimental view transition supportautomatic preconnect in the image directivedefer loading of the animations modulestyle and styleUrls as strings\u2026\" \/>\n<meta property=\"og:url\" content=\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/\" \/>\n<meta property=\"og:site_name\" content=\"Itenium\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-15T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-28T12:31:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png\" \/>\n\t<meta property=\"og:image:width\" content=\"360\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Usdevelop\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Usdevelop\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/\",\"name\":\"Angular 17 - What's new? - Itenium\",\"isPartOf\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png\",\"datePublished\":\"2024-02-15T23:00:00+00:00\",\"dateModified\":\"2025-11-28T12:31:42+00:00\",\"author\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022\"},\"breadcrumb\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png\",\"contentUrl\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png\",\"width\":360,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/demo.sidekick.be\/itenium\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Angular 17 &#8211; What&#8217;s new?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#website\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/\",\"name\":\"Itenium\",\"description\":\"We build software. We build careers.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/demo.sidekick.be\/itenium\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022\",\"name\":\"Usdevelop\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g\",\"caption\":\"Usdevelop\"},\"sameAs\":[\"https:\/\/demo.sidekick.be\/itenium\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Angular 17 - What's new? - Itenium","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Angular 17 - What's new? - Itenium","og_description":"Angular 17 has landed with a rebranding, and an a new documentation home which now also offers an interactive learning experience, but what else is new?There are a plethora of improvements such as:hydration graduated from developer previewstandalone APIs is now the defaultnew @angular\/ssr packageimproved SSR functionalitythe Signals API is mostly out of developer preview (effect() remains in it)new afterRender and afterNextRender lifecycle hooksVite &amp; esbuild are now the default for new projectsexperimental view transition supportautomatic preconnect in the image directivedefer loading of the animations modulestyle and styleUrls as strings\u2026","og_url":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/","og_site_name":"Itenium","article_published_time":"2024-02-15T23:00:00+00:00","article_modified_time":"2025-11-28T12:31:42+00:00","og_image":[{"width":360,"height":300,"url":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png","type":"image\/png"}],"author":"Usdevelop","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Usdevelop","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/","url":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/","name":"Angular 17 - What's new? - Itenium","isPartOf":{"@id":"https:\/\/demo.sidekick.be\/itenium\/#website"},"primaryImageOfPage":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage"},"image":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage"},"thumbnailUrl":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png","datePublished":"2024-02-15T23:00:00+00:00","dateModified":"2025-11-28T12:31:42+00:00","author":{"@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022"},"breadcrumb":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#primaryimage","url":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png","contentUrl":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/angular-17.png","width":360,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/angular17\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/demo.sidekick.be\/itenium\/"},{"@type":"ListItem","position":2,"name":"Angular 17 &#8211; What&#8217;s new?"}]},{"@type":"WebSite","@id":"https:\/\/demo.sidekick.be\/itenium\/#website","url":"https:\/\/demo.sidekick.be\/itenium\/","name":"Itenium","description":"We build software. We build careers.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/demo.sidekick.be\/itenium\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022","name":"Usdevelop","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g","caption":"Usdevelop"},"sameAs":["https:\/\/demo.sidekick.be\/itenium"]}]}},"_links":{"self":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/comments?post=1435"}],"version-history":[{"count":3,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":2267,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1435\/revisions\/2267"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/media\/2003"}],"wp:attachment":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/media?parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/categories?post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/tags?post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}