<?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 Dennis Luken on Medium]]></title>
        <description><![CDATA[Stories by Dennis Luken on Medium]]></description>
        <link>https://medium.com/@dennisluken?source=rss-1621935ee0d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZH4NGkjmAw8fmASRsRZdyA.jpeg</url>
            <title>Stories by Dennis Luken on Medium</title>
            <link>https://medium.com/@dennisluken?source=rss-1621935ee0d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 09:34:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dennisluken/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[Mastering Dependency Injection in Angular 19.2: A Standalone Architecture Guide]]></title>
            <link>https://medium.com/@dennisluken/mastering-dependency-injection-in-angular-19-2-a-standalone-architecture-guide-2088654bd42a?source=rss-1621935ee0d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2088654bd42a</guid>
            <dc:creator><![CDATA[Dennis Luken]]></dc:creator>
            <pubDate>Thu, 27 Feb 2025 16:11:29 GMT</pubDate>
            <atom:updated>2025-02-27T16:11:29.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSkvoeflt34Mr_O161n2bw.png" /></figure><h3>🚀 Angular 19.2 &amp; Standalone Architecture: Mastering Dependency Injection</h3><p>Angular 19.2 continues to refine its Standalone Component architecture, making applications more modular, scalable, and efficient. One of the biggest advantages? A more powerful and flexible Dependency Injection (DI) system.</p><p>If you’re transitioning to Standalone Components, understanding how DI works in this architecture is key to unlocking better performance and maintainability in your Angular apps. Let’s dive into what’s new, best practices, and how to optimize DI in standalone applications!</p><h3>🔥 How Dependency Injection Works in Standalone Components</h3><p>In traditional Angular applications, services were typically provided at the module level using NgModule.providers. But with Standalone Components, we now have more granular control over where and how dependencies are injected.</p><h3>✅ Global Services with providedIn</h3><p>You can still provide services globally using { providedIn: ‘root’ }, ensuring they are singleton and tree-shakable.</p><p>👉 Example: Global Singleton Service</p><pre>@Injectable({<br>  providedIn: &#39;root&#39; // Globally available<br>})<br>export class AuthService {<br>  constructor(private http: HttpClient) {}<br>}</pre><p>Why it matters: Keeps the service available everywhere without manually adding it to providers.</p><h3>🛠️ Providing Services in Standalone Components</h3><p>With Standalone Components, we don’t need NgModule to provide dependencies. Instead, we declare them directly within the providers array of the component itself.</p><p>👉 Example: Providing a Service in a Standalone Component</p><pre>import { Component, inject } from &#39;@angular/core&#39;;<br>import { CommonModule } from &#39;@angular/common&#39;;<br>import { AuthService } from &#39;./auth.service&#39;;</pre><pre>@Component({<br>  selector: &#39;app-login&#39;,<br>  standalone: true,<br>  imports: [CommonModule],<br>  providers: [AuthService], // Provided only for this component and its children<br>  template: `&lt;p&gt;Login works!&lt;/p&gt;`,<br>})<br>export class LoginComponent {<br>  private authService = inject(AuthService); // New Angular inject() function<br>}</pre><p>Why it matters:</p><ul><li>The AuthService is only available within LoginComponent and its children.</li><li>This helps scope services more efficiently, reducing memory usage.</li></ul><h3>🌍 Feature-Specific DI with providedIn: any</h3><p>If you want a service to be shared across multiple feature modules but not globally, use { providedIn: ‘any’ }. This ensures a single instance per injector hierarchy.</p><p>👉 Example: Scoped DI for Feature Modules</p><pre>@Injectable({<br>  providedIn: &#39;any&#39; // Available in feature modules but not globally<br>})<br>export class LoggingService {<br>  log(message: string) {<br>    console.log(message);<br>  }<br>}</pre><p>Why it matters:</p><ul><li>Reduces unnecessary service instances.</li><li>Helps optimize performance in lazy-loaded modules.</li></ul><h3>💡 Best Practices for Dependency Injection in Standalone Angular Apps</h3><p>✅ Use providedIn: ‘root’ for global services — Ideal for authentication, API clients, and app-wide utilities.</p><p>✅ Scope services at the component level — Use providers in standalone components when the service is only needed within a specific feature.</p><p>✅ Leverage providedIn: ‘any’ for feature-specific services — Ensures reusability while avoiding global pollution.</p><p>✅ Use the inject() function for cleaner code — Instead of using constructor(private service: MyService), you can now use:</p><pre>const authService = inject(AuthService);</pre><p>This is useful for DI inside functions, standalone components, and directives.</p><p>✅ Prefer environment-based providers for flexible configurations — Helps inject different service implementations based on environments.</p><h3>🚀 Final Thoughts</h3><p>Angular 19.2’s Standalone Components bring a new level of flexibility to Dependency Injection, allowing for better modularity, improved tree-shaking, and optimized service scope.</p><p>By leveraging component-level DI, inject(), and scoped providers, you can build faster, more maintainable, and scalable Angular applications.</p><p>💬 Are you using Standalone Components in your Angular projects? How has DI changed for you in Angular 19.2? Let’s discuss below! 👇</p><p>#Angular #Angular19 #DependencyInjection #WebDevelopment #TypeScript #JavaScript</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2088654bd42a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s Wrong With the New Medium Layout… IMHO]]></title>
            <link>https://medium.com/@dennisluken/whats-wrong-with-the-new-medium-layout-imho-2d5f6864bab8?source=rss-1621935ee0d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d5f6864bab8</guid>
            <category><![CDATA[layout]]></category>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[grumpy-old-men]]></category>
            <category><![CDATA[interface-design]]></category>
            <dc:creator><![CDATA[Dennis Luken]]></dc:creator>
            <pubDate>Tue, 13 Feb 2018 13:51:10 GMT</pubDate>
            <atom:updated>2018-02-13T13:53:27.636Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*PiLJdEDcQvRkWtoKBBQbPw.png" /></figure><p>Medium was real gem when I found it. I signed up, paid my $50 to get access to all of the content, selected my interests and found my home page filled with the sections I was looking for and articles I was interested in. I even installed the app on my phone, which was a big surprise to my kids because I am still a bit of a Luddite when it comes to periodicals and books… I like to be able feel the paper.</p><p>Recently, Medium got a makeover. I don’t like it. At the risk of sounding like the grumpy “get off my lawn” guy, here’s why…</p><ol><li>Featured articles.<br>Did I ask for this? I do not even remember if this was a section in the old layout. Now it takes up almost the entire first vertical screen. Today, I see 8 featured articles, none of which I am interested in so I have to scroll down one full screen to get past that.</li><li>Torn between two columns.<br>The next screen’s worth of real estate has two columns, two-thirds width on the left for “Top stories for you” and one-third on the right “New from your network.”<br>What is the difference between these two columns? I feel as though there might be a bit of an identity crisis going on here. My network is, at least it was, articles from the topics I indicated that I was interested in. So I guess that is ok, however, it seems to be just 4 random stories from all my interests… not sure if this is really useful to me.<br>I am still not sure what “Top Stories For You” is supposed to be. I thought perhaps that it might base on my bookmarks and/or claps, but the section below it is “Based on your reading history” so maybe that is based on bookmarks and/or claps. I desperately hope that it is not based on articles that I simply open, but I am not sure.</li><li>Back to the “right” side<br>Below the “New from your network” in the right column is a short list of “Popular on Medium.” Again, I did not ask for this. I do not remember if this was even a section in the old layout, which is good because if it was then it was not somewhere that interfered with me seeing the articles I was interested in, categorized by the topics I indicated I was interested in.<br>Below this useless section comes “Reading List”, which used to be a small button that I could go to if I wanted to see me reading list. I am unclear as to how having what appears to be 4 random items from my reading list taking up space that could otherwise be used to show me new articles from my selected interests.</li><li>And then on the left side…<br>Underneath the “Based on your reading history” section comes the “You might like” section. I really cannot figure out the difference between these two. In the left main column we have: “Top Stories For You”, “Based on your reading history”, and “You might like”, which takes four full screens to get to the bottom of, and then we get to an inset box with 4 articles on “Nassar’s Sentencing”, another full vertical screen, which I certainly did not ask for, not with a selection, not with my bookmarks, not with my claps, not even with the articles I opened but did not read, bookmark or clap for… why am I seeing this.</li><li>Finally, the stuff I asked for…<br>Five full vertical screens down, five full mouse wheel scrolls, I see the first appearance of a topic that I selected. Unfortunately, because the column is two-thirds the width of my screen it is now more difficult to scan the summaries. The articles used to be two across, side-by side, making their effective column width just a little wider than a typical newspaper column, four to seven words across — there is a reason why newspaper columns are that width… it makes it easier to scan copy. I could scan through several articles in seconds, picking and choosing which I wanted to read. With the article summaries so wide, it takes me an irritatingly longer time to parse the subject of the articles. Also, while I am on this section, the “Reading List” section on the right side is now anchored and distracts my eye, pulling my attention away from the summaries I am trying to grok.</li><li>But not everything I asked for<br>In this section, the section that used to be the most useful, the section where I am hoping to see the articles that I am interested in based on the topics I selected… I only see three of the seven topics I selected. Where are my other four topics? They used to be displayed, quite nicely, and now they are gone.</li><li>Someone skipped The class on how to Capitalize titles<br>FEATURED<br>Top stories for you<br>New from your network<br>Popular on Medium<br>Based on your reading history<br>You might like<br>Reading List<br>Nassar’s sentencing<br>Featured for members</li><li>It’s Not All Bad<br>The ability to bookmark and article right in the summary for it is a nice feature. Well done.</li></ol><p>If this new layout works for folks out there then I am super happy for you. However, I would be extremely appreciative if Medium would make it possible to select the old layout. There is nothing new in the new layout except lack of readability and organization and flow… and those things I can do without.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d5f6864bab8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>