Frontend

Articles about Frontend on omid.dev — guides, topics, and notes from the field.

How to Build a Frontend Testing Strategy That Actually Scales

Published: June 9, 2026 Reading Time: 11 min

Most frontend teams do not have a testing problem because they lack tests. They have a testing problem because nobody can explain why a specific test exists. The result is familiar: hundreds of unit tests that prove implementation details; a few end-to-end tests that fail whenever timing changes; component tests that duplicate what unit tests already cover; slow CI pipelines that people stop trusting; high coverage numbers with very little confidence. This is especially common in large Angular codebases. Angular gives teams a serious testing toolbox: TestBed, standalone components, dependency injection, router testing, HTTP testing utilities, harnesses, and good compatibility with tools like Jest, Vitest, Cypress, and Playwright. The tooling is not the hard part. ...

Continue Reading

Why Your Frontend Tests Flake and How to Fix Them for Good

Published: June 8, 2026 Reading Time: 11 min

Flaky tests are worse than failing tests. A failing test tells the team something broke. A flaky test teaches the team to negotiate with reality: “Run it again.” “CI is weird today.” “It passes locally.” “That test always fails on Mondays.” “Merge it, the failure is unrelated.” That is how a test suite loses authority. The first few flakes feel harmless. Then people stop reading failures carefully. Then a real regression hides inside the noise. ...

Continue Reading

Stop Modeling Angular Screens with Five Booleans

Published: June 2, 2026 Reading Time: 11 min

Open almost any mature Angular screen and you will find the same shape: 1 2 3 4 5 loading = false; error: string | null = null; data: Account[] | null = null; retrying = false; submitted = false; The template then becomes a negotiation: 1 2 3 4 5 6 7 8 9 @if (loading) { <app-spinner /> } @else if (error) { <app-error [message]="error" /> } @else if (!data?.length) { <app-empty-state /> } @else { <account-table [rows]="data!" /> } This looks fine. It ships. It passes review. And then production teaches you that the screen was never modeled as one thing. It was modeled as five independent switches that sometimes agree and sometimes do not. ...

Continue Reading

Why I Started Adding Full Source Code to My Blog Posts

Published: June 1, 2026 Reading Time: 4 min

One thing I have always found frustrating in technical writing is the gap between a nice explanation and code you can actually explore. A post can explain an idea clearly, but if the code is only a few isolated snippets, the reader still has to imagine the project around it. Where does this file live? What package versions were used? How do the pieces connect? Can I run it, or is it only illustrative? ...

Continue Reading

Angular Is Quietly Becoming AI-Tool Friendly: What MCP Server Support Changes for Real Teams

Published: May 27, 2026 Reading Time: 5 min

Angular has always had a complicated relationship with tooling. People call it “heavy” when they want something lighter, but that same weight is often what helps large teams keep moving without reinventing the architecture every sprint. That is why Angular’s MCP server work in the Angular 21 cycle is more interesting than another code-generation headline. This is not just “AI can write Angular now.” AI could already write Angular, often badly. The real question is whether Angular can give AI tools enough project-aware context to stop generating outdated, half-remembered patterns. ...

Continue Reading

The Hidden Cost of Nice Syntax: When Angular's New Template Features Make Code Harder to Reason About

Published: May 26, 2026 Reading Time: 5 min

Every framework eventually discovers the same truth: developers love nice syntax until nice syntax becomes a hiding place. Angular’s recent template improvements are genuinely useful. Multiple consecutive @case blocks make some @switch statements cleaner. Spread and rest support in templates removes awkward helper code in small cases. Angular 21.2’s template additions, such as arrow functions and exhaustive @switch checks with @default never, continue the same direction: templates are becoming more expressive and more type-aware. ...

Continue Reading

Signal Forms Aren't Just a Forms API Update: They Change How You Model UI State

Published: May 25, 2026 Reading Time: 6 min

Most forms discussions start in the wrong place. They compare syntax. Reactive Forms gives us FormGroup, FormControl, validators, status flags, and a lot of well-known muscle memory. Signal Forms gives us fields, signal-shaped state, form-level submission, custom controls, and migration tools. It is tempting to treat this as a cleaner API for the same old job. But that misses the bigger shift. Signal Forms are not only about filling inputs and showing validation messages. They push forms into the same mental model as the rest of modern Angular state: explicit signals, derived values, and state transitions that can be composed instead of chased through subscriptions. ...

Continue Reading

Unlocking the Power of Angular's `@ViewChild` and `@ContentChild`

Published: September 8, 2024 Reading Time: 6 min

Angular’s @ViewChild and @ContentChild decorators provide a powerful way to interact with child components, DOM elements, and projected content within a component’s template. While they are often misunderstood or used interchangeably, each has its own specific purpose and use cases. In this comprehensive guide, we’ll dive deep into both decorators, understanding their differences, use cases, and best practices. Additionally, we’ll explore advanced techniques for leveraging them in various scenarios and edge cases, complete with sample code for hands-on understanding. ...

Continue Reading

Migrating from REST to GraphQL: A Step-by-Step Guide for Express.js and Angular

Published: August 7, 2024 Reading Time: 6 min

In today’s rapidly evolving web development landscape, GraphQL has emerged as a powerful alternative to traditional REST APIs. This blog post will guide you through the process of migrating your Express.js backend and Angular frontend from REST to GraphQL, unlocking the benefits of a more flexible and efficient API architecture. Companion resource Companion Project Explore the complete working example on GitHub. github.com/omidfarhang/example-projects/examples/graphql-express-angular-migration View on GitHub 1. Introduction REST (Representational State Transfer) has been the go-to architectural style for building web APIs for many years. However, GraphQL, developed by Facebook, offers several advantages: ...

Continue Reading

Creating Dynamic Music Visualizations with Angular and the Web Audio API

Published: July 13, 2024 Reading Time: 11 min

Music visualization has always been a fascinating way to enhance the auditory experience, offering a visual representation of sound that can be both mesmerizing and informative. With the power of modern web technologies like Angular and the Web Audio API, creating dynamic music visualizations is more accessible than ever. This blog post will guide you through the process of building an engaging music visualization application using Angular and the Web Audio API. ...

Continue Reading