<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Angular on Build in Public</title><link>https://build.ralphmayr.com/tags/angular/</link><description>Recent content in Angular on Build in Public</description><generator>Hugo</generator><language>en-us</language><copyright>©️ Ralph Mayr 2026</copyright><lastBuildDate>Tue, 30 Sep 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://build.ralphmayr.com/tags/angular/index.xml" rel="self" type="application/rss+xml"/><item><title>Angular data binding with arrays: Yes, it can work!</title><link>https://build.ralphmayr.com/posts/92-angular-data-binding-with-arrays-yes-it-can-work/</link><pubDate>Tue, 30 Sep 2025 00:00:00 +0000</pubDate><guid>https://build.ralphmayr.com/posts/92-angular-data-binding-with-arrays-yes-it-can-work/</guid><description>&lt;p&gt;Angular is awesome. And data binding, in particular, has been a game changer for developing modern web apps. Something changes somewhere and&amp;mdash;magically&amp;mdash;every part of your UI that needs to respond does so.&lt;/p&gt;
&lt;p&gt;However, I&amp;rsquo;ve always struggled with one corner case: What if you&amp;rsquo;re binding to an array, and the change that occurs is that something gets added or removed, and you need to respond to the change programmatically (not just in your HTML template)?&lt;/p&gt;</description></item><item><title>Object.assign(...) in JavaScript helps with asynchronous updates</title><link>https://build.ralphmayr.com/posts/52-object-assign-in-javascript-helps-with-asynchronous-updates/</link><pubDate>Thu, 21 Aug 2025 00:00:00 +0000</pubDate><guid>https://build.ralphmayr.com/posts/52-object-assign-in-javascript-helps-with-asynchronous-updates/</guid><description>&lt;p&gt;In
&lt;a href="../51-websockets-more-than-tech-vanity/"&gt;WebSockets: More than tech vanity&lt;/a&gt;, I talked about the implicit user value of asynchronous UIs. Today, here&amp;rsquo;s a neat little JavaScript trick I hadn&amp;rsquo;t been aware of that makes implementing them a bit easier: &lt;code&gt;Object.assign(...)&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s the situation:&lt;/p&gt;
&lt;p&gt;Your Angular frontend initially fetches a list of items from the backend. Thanks to Angular&amp;rsquo;s powerful data binding, many components reference properties of these objects. Later, the backend sends an updated version of one of these items via WebSocket. What now?&lt;/p&gt;</description></item><item><title>You Don’t Need an nl2br Pipe</title><link>https://build.ralphmayr.com/posts/43-you-dont-need-an-nl2br-pipe/</link><pubDate>Tue, 12 Aug 2025 00:00:00 +0000</pubDate><guid>https://build.ralphmayr.com/posts/43-you-dont-need-an-nl2br-pipe/</guid><description>&lt;p&gt;This one&amp;rsquo;s a pretty common hassle: You&amp;rsquo;ve got text with line breaks (encoded as \n or sometimes \r\n &amp;mdash; thanks, Microsoft!), but when rendering that text on a webpage, those line breaks are nowhere to be seen. Naturally, browsers collapse &amp;lsquo;source&amp;rsquo; line breaks and ignore them.&lt;/p&gt;
&lt;p&gt;The usual reaction? Reach for an nl2br utility &amp;mdash; like
&lt;a href="https://www.npmjs.com/package/nl2br-pipe" target="_blank" rel="noopener noreferrer"&gt;nl2br-pipe&lt;/a&gt;&amp;mdash;to manually replace \n with &amp;lt;br /&amp;gt; tags. It&amp;rsquo;s a well-known workaround in web dev.&lt;/p&gt;</description></item><item><title>Mind the Gap — flex-gap!</title><link>https://build.ralphmayr.com/posts/33-mind-the-gap-flex-gap/</link><pubDate>Sat, 02 Aug 2025 00:00:00 +0000</pubDate><guid>https://build.ralphmayr.com/posts/33-mind-the-gap-flex-gap/</guid><description>&lt;p&gt;I use flex-based layouts a lot in the #Angular frontend of poketto.me. But I never realized there&amp;rsquo;s a neat little property called gap (or flex-gap) that lets you define spacing between flex items directly.&lt;/p&gt;
&lt;p&gt;For the longest time, I worked around this with clumsy constructs where I&amp;rsquo;d set margins on child elements &amp;mdash; and then unset them on the last child:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;.container {
display: flex;
flex-direction: column;
.child {
margin-bottom: 1rem;
&amp;amp;:last-child {
margin-bottom: unset;
}
}
}
```
When really, the world could be so much simpler:
```
.container {
display: flex;
flex-direction: column;
gap: 1rem;
}
```
No more margin hacks.
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Material’s tooltip interferes with touch-scrolling on mobile</title><link>https://build.ralphmayr.com/posts/16-materials-tooltip-interferes-with-touch-scrolling-on-mobile/</link><pubDate>Wed, 16 Jul 2025 00:00:00 +0000</pubDate><guid>https://build.ralphmayr.com/posts/16-materials-tooltip-interferes-with-touch-scrolling-on-mobile/</guid><description>&lt;p&gt;As I mentioned the other day, I love Angular Material. However, I was quite surprised to discover that the matTooltip directive can negatively impact the user experience on mobile 🤯&lt;/p&gt;
&lt;p&gt;I noticed that users couldn&amp;rsquo;t 'drag to scroll' on poketto.me on their phones (in both the Android app and the browser) when they started to drag particular elements on the screen, such as the save title images.&lt;/p&gt;
&lt;p&gt;After a lot of analysis and debugging, I discovered that the matTooltip directive, which I use to render tooltips displaying the full save title in case it is abbreviated, sets touch-action: none; on that element. This means: On a mobile device, users can't start scrolling the page with that element as an anchor. It feels totally weird!&lt;/p&gt;</description></item></channel></rss>