{"id":2342,"date":"2025-08-27T05:06:22","date_gmt":"2025-08-27T12:06:22","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=2342"},"modified":"2025-08-27T05:06:23","modified_gmt":"2025-08-27T12:06:23","slug":"whats-new-in-angular-20-2","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/whats-new-in-angular-20-2\/","title":{"rendered":"What&#8217;s new in Angular 20.2?"},"content":{"rendered":"\n<p>Another month, another minor version of our favorite front-end framework!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Zoneless<\/h2>\n\n\n\n<p>This time around, Zoneless change detection becomes stable (more about <a href=\"https:\/\/blog.angulartraining.com\/what-does-zoneless-angular-mean-0a3a9d2a047d\" target=\"_blank\" rel=\"noopener\" title=\"\">Zoneless here<\/a>), so you can remove Zone.js from the equation if you&#8217;ve followed the <a href=\"https:\/\/angular.dev\/guide\/zoneless#requirements-for-zoneless-compatibility\" target=\"_blank\" rel=\"noopener\" title=\"\">rules<\/a> to make sure Angular will detect your changes properly with OnPush-compatible components.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Animations<\/h2>\n\n\n\n<p>The @angular\/animations package is deprecated and replaced with a new API using the\u00a0<code>animate.enter<\/code>\/<code>animate.leave<\/code>\u00a0syntax as follows:<\/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\"> <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">animate.enter<\/span>=<span class=\"hljs-string\">\"fade-in\"<\/span> <span class=\"hljs-attr\">animate.leave<\/span>=<span class=\"hljs-string\">\"fade-out\"<\/span>&gt;<\/span>My content<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span><\/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<h2 class=\"wp-block-heading\">Aliases in blocks<\/h2>\n\n\n\n<p>You can use local aliases in <code>if<\/code>, <code>else<\/code>, and <code>else if<\/code> blocks as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">\n\u2060@<span class=\"hljs-keyword\">if<\/span> (currentUser(); <span class=\"hljs-keyword\">as<\/span> user) {\n  Welcome user {{ user.name }}!\n} @<span class=\"hljs-keyword\">else<\/span> <span class=\"hljs-keyword\">if<\/span> (expiredSession(); <span class=\"hljs-keyword\">as<\/span> exp) {\n  Please log <span class=\"hljs-keyword\">in<\/span>. Your session expired at {{ exp.time }}\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">New diagnostics<\/h2>\n\n\n\n<p>Diagnostics give you hints and feedback on possible mistakes. These apply to instances where your code compiles but is likely doing something wrong. A new diagnostic called&nbsp;<code>uninvokedFunctionInTextInterpolation<\/code>&nbsp;has been added to warn you when you use a method in a template without calling it (forgot the parentheses).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testing<\/h2>\n\n\n\n<p>You can now use a headless browser with your Vitest unit tests using the builder introduced in v20. This is still experimental, though.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>As a reminder, here are the <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/whats-new-in-angular-20-1\/\" target=\"_blank\" rel=\"noopener\" title=\"\">updates from the previous version, Angular 20.1<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another month, another minor version of our favorite front-end framework! Zoneless This time around, Zoneless change detection becomes stable (more about Zoneless here), so you can remove Zone.js from the equation if you&#8217;ve followed the rules to make sure Angular will detect your changes properly with OnPush-compatible components. Animations The @angular\/animations package is deprecated and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2342","post","type-post","status-publish","format-standard","hentry","category-angular"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/comments?post=2342"}],"version-history":[{"count":2,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2342\/revisions"}],"predecessor-version":[{"id":2344,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/2342\/revisions\/2344"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=2342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=2342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=2342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}