<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Owais Alam on Medium]]></title>
        <description><![CDATA[Stories by Owais Alam on Medium]]></description>
        <link>https://medium.com/@owaisalam019?source=rss-5f1991276fe6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*crRW8Tekv9KYg_S-RbRXRw.jpeg</url>
            <title>Stories by Owais Alam on Medium</title>
            <link>https://medium.com/@owaisalam019?source=rss-5f1991276fe6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 00:23:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@owaisalam019/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Overview of the November Release’s New Features for Angular Control Flow]]></title>
            <link>https://owaisalam019.medium.com/an-overview-of-the-november-releases-new-features-for-angular-control-flow-6f38961db3ca?source=rss-5f1991276fe6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f38961db3ca</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[control-flow]]></category>
            <category><![CDATA[conditional-statements]]></category>
            <category><![CDATA[control-flow-statement]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Owais Alam]]></dc:creator>
            <pubDate>Thu, 05 Oct 2023 07:21:29 GMT</pubDate>
            <atom:updated>2023-10-05T07:21:29.463Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K-234r0My_c_5AEs" /><figcaption>Photo by <a href="https://unsplash.com/@ffstop?utm_source=medium&amp;utm_medium=referral">Fotis Fotopoulos</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Control flow directives in Angular, such as <em>*</em><a href="https://angular.io/api/common/NgIf"><em>ngIf</em></a><em>, *</em><a href="https://angular.io/api/common/NgFor"><em>ngFor</em></a><em>,</em> and *<a href="https://angular.io/api/common/NgSwitch">ngSwitch</a>, have been a mainstay of the framework from its creation. These directives, however, have certain disadvantages, such as being difficult to apply in complicated templates and being incompatible with the new signal-based change detection technique.</p><p>To address these concerns, the Angular team is developing a new built-in syntax for control flow in Angular 17, which will be released in November 2023. This new syntax is more expressive and simpler than the previous directives, and it is also compatible with the new change detection technique.</p><p>Here’s a sneak peek at the new control flow features:</p><h4>@if</h4><p>The <a href="http://twitter.com/if"><strong>@if</strong></a> block allows you to write conditional statements in your templates in a more simple and declarative manner. Consider the following code:</p><pre>&lt;div *ngIf=&quot;show&quot;&gt;<br>  This element will be rendered if `show` is true.<br>&lt;/div&gt;</pre><p>Can be rewritten as:</p><pre>&lt;div @if(show)&gt;<br>  This element will be rendered if `show` is true.<br>&lt;/div&gt;</pre><p>More sophisticated conditional statements, such as else-if and else clauses, can also be written using the @if block.</p><p><strong>@for</strong></p><p>In your templates, the <strong>@for</strong> block offers a new way to iterate over iterable objects. It gives several useful context attributes, including the current index and whether the current item is the first or last in the list.</p><p>Consider the following code:</p><pre>&lt;ul *ngFor=&quot;let item of items&quot;&gt;<br>  &lt;li&gt;{{item}}&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>It is possible to rewrite this as:</p><pre>&lt;ul @for(item of items; let i = $index, f = $first, l = $last, ev = $even, odd = $odd)&gt;<br>  &lt;li&gt;{{item}}&lt;/li&gt;<br>&lt;/ul&gt;</pre><p>The <strong>@for</strong> block additionally includes a <strong>@empty</strong> block that is rendered if the iterable object is empty.</p><p><strong>@switch</strong></p><p>The <strong>@switch</strong> block allows you to write switch statements in your templates in a new way. It’s comparable to the existing <strong>*ngSwitch</strong> directive, but it’s shorter and easier to comprehend.</p><p>Consider the following code:</p><pre>&lt;div *ngSwitch=&quot;dayOfWeek&quot;&gt;<br>  &lt;div *ngSwitchCase=&quot;0&quot;&gt;Sunday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;1&quot;&gt;Monday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;2&quot;&gt;Tuesday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;3&quot;&gt;Wednesday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;4&quot;&gt;Thursday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;5&quot;&gt;Friday&lt;/div&gt;<br>  &lt;div *ngSwitchCase=&quot;6&quot;&gt;Saturday&lt;/div&gt;<br>  &lt;div *ngSwitchDefault&gt;Unknown day of week&lt;/div&gt;<br>&lt;/div&gt;</pre><p>It is possible to rewrite this as:</p><pre>&lt;div @switch(dayOfWeek)&gt;<br>  @switchCase(0): Sunday<br>  @switchCase(1): Monday<br>  @switchCase(2): Tuesday<br>  @switchCase(3): Wednesday<br>  @switchCase(4): Thursday<br>  @switchCase(5): Friday<br>  @switchCase(6): Saturday<br>  @switchDefault: Unknown day of week<br>&lt;/div&gt;</pre><p>The new control flow syntax is still in the works, but it will be included in Angular 17 in November 2023. The Angular team invites developers to experiment with the new syntax and provide feedback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f38961db3ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>