<?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 Magdalena Chmura on Medium]]></title>
        <description><![CDATA[Stories by Magdalena Chmura on Medium]]></description>
        <link>https://medium.com/@magdalena-webdev?source=rss-6a9cbd8b4844------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*A4GmbUDvJw_EDtcGSW54BQ.png</url>
            <title>Stories by Magdalena Chmura on Medium</title>
            <link>https://medium.com/@magdalena-webdev?source=rss-6a9cbd8b4844------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 11:37:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@magdalena-webdev/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[Angular I18nSelect Pipe ]]></title>
            <link>https://magdalena-webdev.medium.com/angular-i18nselect-pipe-5eaf909a7030?source=rss-6a9cbd8b4844------2</link>
            <guid isPermaLink="false">https://medium.com/p/5eaf909a7030</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[webdev]]></category>
            <dc:creator><![CDATA[Magdalena Chmura]]></dc:creator>
            <pubDate>Thu, 11 Feb 2021 18:43:14 GMT</pubDate>
            <atom:updated>2021-02-11T18:51:29.654Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="&lt;span&gt;Photo by &lt;a href=”https://unsplash.com/@goumbik?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Lukas Blazek&lt;/a&gt; on &lt;a href=”https://unsplash.com/s/photos/blog?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText&quot;&gt;Unsplash&lt;/a&gt;&lt;/span&gt;" src="https://cdn-images-1.medium.com/max/1024/1*aX3K-rFVF7jNdTtuUCFnMA.jpeg" /></figure><p>I18nSelect is an Angular built-in pipe that takes a string as an argument and displays a corresponding value from the mapping object.</p><p>It is very useful especially when working with <strong>pluralization </strong>and <strong>gender information </strong>🧑🏽👩🏼🧑</p><p>Let’s take a look at a simple party guest list 🎉<br>We’re going to introduce each of the guests. To do so we need to use the correct conjugations and pronouns. And here comes the i18nSelect pipe.</p><pre><br>public guests = [<br> {<br>   gender: &#39;female&#39;,<br>   name: &#39;Fallon&#39;,<br>   age: 27<br> },<br> {<br>   gender: &#39;male&#39;,<br>   name: &#39;Blake&#39;,<br>   age: 46<br> },<br> {<br>   gender: &#39;other&#39;,<br>   name: &#39;Miki&#39;,<br>   age: 32<br> }<br>];</pre><p>Next step is creating the mapping objects.</p><ul><li><strong>genderMap </strong>is defining the mapping between gender and pronouns</li><li><strong>verbMap </strong>is defining the mapping between gender and verbs</li></ul><pre>genderMap = { <br>  male: &#39;he&#39;, <br>  female: &#39;she&#39;, <br>  other: &#39;they&#39; <br>};</pre><pre>verbMap = { <br>  male: &#39;is&#39;, <br>  female: &#39;is&#39;, <br>  other: &#39;are&#39; };<br>}</pre><p>Once the mapping rules are defined we are ready to use them in the template 🔥</p><pre>&lt;div *ngFor=”let guest of guests”&gt;<br> &lt;div&gt;<br> &lt;span&gt; This is {{ guest.name }}, &lt;/span&gt;<br> &lt;span&gt; {{ guest.gender | i18nSelect : genderMap }} &lt;/span&gt;<br> &lt;span&gt; {{ guest.gender | i18nSelect : verbMap }} &lt;/span&gt;<br> &lt;span&gt; {{ guest.age}} &lt;/span&gt; year old.<br> &lt;/div&gt;<br>&lt;/div&gt;<br></pre><p>Output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*U0sVQx1S4iuK2gg-Ljm4mQ.jpeg" /></figure><p>Hope you’re having a great one, and I’ll see you for more<strong> 60 Seconds of Angular</strong> posts in the future 🥳</p><p>In case you missed it:</p><p><a href="https://magdalenachmura.medium.com/angular-keyvalue-pipe-44b2ba35ec19">Angular KeyValue Pipe</a> 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5eaf909a7030" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular KeyValue Pipe ]]></title>
            <link>https://magdalena-webdev.medium.com/angular-keyvalue-pipe-44b2ba35ec19?source=rss-6a9cbd8b4844------2</link>
            <guid isPermaLink="false">https://medium.com/p/44b2ba35ec19</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Magdalena Chmura]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 08:27:12 GMT</pubDate>
            <atom:updated>2021-02-09T08:29:38.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrNn1CWJdyn3CQ2wJZ6p8w.png" /></figure><p><em>KeyValue </em>pipe is an Angular built-in feature that transforms objects or maps into an array of key-value pairs.</p><p>If you’ve been working with Angular since its early versions, you might have missed it as the <em>KeyValue </em>pipe was introduced in <strong>Angular 6.1</strong>.</p><p>Let’s see it in action 🔥</p><p>Imagine a simple object that stores student’s names as a key and an array of grades as a value.</p><pre>const students = {<br> Susane: [4, 3, 2, 1, 5],<br> Jenifer: [3, 5, 2, 2],<br> John: [5, 3, 3, 4, 1]<br>};</pre><p>With `KeyValuePipe` you can iterate over objects directly from the template.</p><pre>&lt;ul *ngFor=”let student of (students | keyvalue)”&gt;<br> &lt;li&gt;{{ student.key }}’s grades: {{ student.value }}&lt;/li&gt; <br>&lt;/ul&gt;</pre><p>It is a clean and declarative solution that will allow you to clean up your templates.</p><p>Hope you’re having a great one, and I’ll see you for more 60 Seconds of Angular posts in the future 🥳</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44b2ba35ec19" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>