Angular Development Tutorials

This website is Brian Treese's Angular Development Blog. The site provides practical, hands-on tutorials and resources for developers who use the Angular framework. The tutorials cover modern Angular techniques including Signals, Components, Forms, Animations, CDK (Component Dev Kit), and Styling. Each tutorial includes code examples, video demonstrations, and step-by-step instructions to help you build Angular applications.

Angular Expand/Collapse Animation: Animate Height Changes (Deprecated Module)

Angular Expand/Collapse Animation: Animate Height Changes (Deprecated Module)

December 13, 2024

Expand and collapse animations make Angular UIs feel polished and professional. This tutorial demonstrates how to animate height changes using Angular's deprecated animations module. While this approach still works, modern Angular (v19+) offers better alternatives using CSS animations and DOM events. You'll learn the legacy approach here, but for new projects, consider using pure CSS transitions or Angular's new enter/leave animation API.

Angular Signals: set() vs update() - When to Use Each

Angular Signals: set() vs update() - When to Use Each

December 06, 2024

Choosing between set() and update() for writable signals in Angular seems trivial, but the wrong choice leads to verbose code, unnecessary complexity, or missed optimization opportunities. set() replaces the entire signal value, while update() transforms the current value using a callback function. This tutorial explains when each method is appropriate, demonstrates real-world examples, and shows how to write cleaner, more efficient signal update code.

Angular linkedSignal(): Advanced Features and Multiple Sources (v19+)

Angular linkedSignal(): Advanced Features and Multiple Sources (v19+)

November 29, 2024

Angular's linkedSignal() goes beyond simple two-way binding with advanced features that enable intelligent update logic. By comparing old and new values, you can create conditional updates, prevent unnecessary changes, and implement complex state synchronization patterns. This tutorial explores advanced linkedSignal() features including value comparison callbacks, multiple source signals, and smart update strategies that optimize performance and reduce unnecessary re-renders.

Angular Signal Queries: Replace @ContentChild with contentChild() (v19+)

Angular Signal Queries: Replace @ContentChild with contentChild() (v19+)

November 22, 2024

Content projection in Angular requires querying projected content, but the old @ContentChild and @ContentChildren decorators have limitations: they're not reactive, require lifecycle hooks, and don't integrate well with signals. The new contentChild() and contentChildren() signal queries solve these problems by providing automatic reactivity, better type safety, and seamless signal integration. This tutorial shows you how to migrate from decorator-based content queries to the modern signal query API.

Angular linkedSignal(): Create Writable Signals from Other Signals (v19+)

Angular linkedSignal(): Create Writable Signals from Other Signals (v19+)

November 15, 2024

Angular 19 introduces linkedSignal(), a powerful new primitive for creating writable signals that automatically sync with other signals. Unlike computed signals which are read-only, or effects which cause side effects, linked signals provide a clean way to create two-way reactive bindings. This tutorial demonstrates how to use linkedSignal() to simplify form state management, create reactive UI components, and avoid common anti-patterns with effects.

Angular Signal Queries: Replace @ViewChild with viewChild() (v19+)

Angular Signal Queries: Replace @ViewChild with viewChild() (v19+)

November 08, 2024

Angular's @ViewChild and @ViewChildren decorators are being replaced by signal-based query functions that offer better type safety, automatic reactivity, and cleaner code. The new viewChild() and viewChildren() functions eliminate the need for lifecycle hooks, provide reactive updates, and integrate seamlessly with Angular's signal system. This tutorial walks through converting existing decorator-based queries to the modern signal query API, showing real-world examples and migration patterns.

Angular effect(): When NOT to Use It and Better Alternatives

Angular effect(): When NOT to Use It and Better Alternatives

November 01, 2024

Angular's effect() function is often misused, leading to performance issues, unnecessary side effects, and code that's harder to reason about. While effects seem like an easy solution for reacting to signal changes, most scenarios have better alternatives using computed signals, template bindings, or lifecycle hooks. This tutorial shows you when NOT to use effects, demonstrates common anti-patterns, and provides better solutions for each scenario. You'll learn to write more efficient, maintainable Angular code.

Angular Signal Inputs: Replace @Input and ngOnChanges (v19+)

Angular Signal Inputs: Replace @Input and ngOnChanges (v19+)

October 25, 2024

Enabling and disabling form controls based on input changes requires ngOnChanges() lifecycle hooks and manual state management when using traditional @Input decorators. Signal inputs eliminate this complexity by providing reactive values that automatically trigger updates, making form state management simpler and more declarative. This tutorial demonstrates how to migrate from @Input and ngOnChanges() to signal inputs, showing how reactive forms integrate seamlessly with Angular's signal system.

Cursor AI Took My Job… or Did It? Angular Dev Edition

Cursor AI Took My Job… or Did It? Angular Dev Edition

October 18, 2024

AI-powered code editors are transforming how developers work, and Cursor is leading the charge. Built on VS Code, Cursor brings intelligent code suggestions, automated error detection, and powerful AI assistance directly into your Angular workflow. In this tutorial, I'll show you real examples of how I use Cursor in my Angular projects, from refactoring components to generating tests. You'll see why it's become essential to my development process.

Angular Currency Pipe: Complete Guide to Currency Formatting

Angular Currency Pipe: Complete Guide to Currency Formatting

October 11, 2024

Currency formatting mistakes break user trust and create confusion in international applications. Displaying prices incorrectly—wrong decimal places, missing currency symbols, or incorrect locale formatting—makes your app look unprofessional and can lead to user errors. Angular's Currency Pipe handles all these complexities automatically, supporting 150+ locales, proper decimal formatting, and accessibility requirements. This tutorial shows you how to format currency correctly for any locale and use case.

Angular Date Pipe: Complete Guide to Date Formatting

Angular Date Pipe: Complete Guide to Date Formatting

October 04, 2024

Date formatting in Angular applications often causes headaches: inconsistent formats confuse users, locale-specific requirements complicate code, and manual formatting leads to maintenance nightmares. Angular's Date Pipe solves these problems by providing built-in localization, flexible formatting options, and semantic HTML support. This complete guide covers everything from basic date formatting to advanced locale handling, timezone management, and SEO-friendly date markup.

Angular ngTemplateOutlet: Eliminate Repetitive Code in Templates

Angular ngTemplateOutlet: Eliminate Repetitive Code in Templates

September 27, 2024

Code duplication in Angular templates creates maintenance nightmares, bloated bundles, and inconsistent UIs. When you need to update similar markup across multiple components, missing even one instance breaks the user experience. Angular's ng-template and ngTemplateOutlet solve this by letting you define reusable template fragments that can be stamped out anywhere in your app. This tutorial shows you how to eliminate repetitive code, create flexible components, and maintain consistency across your application.

Angular Form Accessibility: Make Forms Accessible for Everyone

Angular Form Accessibility: Make Forms Accessible for Everyone

September 20, 2024

Inaccessible forms exclude millions of users and violate accessibility standards, yet many Angular developers overlook basic accessibility practices. Screen reader users, keyboard-only users, and people with motor impairments need properly labeled fields, clear error messages, and keyboard navigation support. This tutorial demonstrates how to make Angular forms accessible by adding proper labels, ARIA attributes, keyboard support, and visual indicators. You'll learn techniques that improve usability for everyone while ensuring compliance with WCAG guidelines.

Angular Reactive Forms: Create and Enhance Form Controls

Angular Reactive Forms: Create and Enhance Form Controls

September 13, 2024

Building forms in Angular requires understanding Reactive Forms, but many developers struggle with creating form controls, tracking validation states, and providing user feedback. This tutorial shows you how to create form controls using Angular's Reactive Forms Module, track validity and interaction states, and enhance forms with visual feedback based on user input. You'll learn the fundamentals needed to build production-ready forms that guide users through the submission process.

Angular Content Toggle: Show/Hide Content with Buttons

Angular Content Toggle: Show/Hide Content with Buttons

September 06, 2024

Building toggle buttons in Angular doesn't have to be complicated. Whether you need to show/hide content with CSS classes or conditionally render elements, this tutorial covers multiple approaches. You'll learn how to create reusable toggle buttons that control content visibility, handle state management with signals, and implement smooth transitions. By the end, you'll have several patterns you can use in any Angular project.

Angular Crossfade Animation: Fade Between Content (Deprecated Module)

Angular Crossfade Animation: Fade Between Content (Deprecated Module)

August 30, 2024

Crossfade animations create smooth transitions between content changes, image carousels, and tab switches, eliminating jarring instant replacements. While CSS transitions can handle simple fades, coordinating simultaneous fade-out and fade-in effects requires careful timing and state management. This tutorial demonstrates how to create crossfade animations using Angular's animation framework, ensuring smooth transitions between content states. Note: This uses Angular's deprecated animations module—modern alternatives are available.

Angular Flip Animation: Create Card Flip Effects (Deprecated Module)

Angular Flip Animation: Create Card Flip Effects (Deprecated Module)

August 23, 2024

Flip animations create engaging card interactions, reveal effects, and 3D transformations that feel natural and intuitive. Implementing flip animations requires careful coordination of transforms, perspective, and timing to create convincing 3D effects. This tutorial demonstrates how to create flip animations using Angular's animation framework, including proper perspective setup and smooth transitions. Note: This uses Angular's deprecated animations module—modern alternatives are available.

CSS Shapes: The Reference Box

CSS Shapes: The Reference Box

August 20, 2024

CSS Shapes require a reference box to establish a coordinate system for drawing and positioning shapes. The reference box determines how shapes are calculated relative to the element's box model (margin, border, padding, or content box). This tutorial explains how reference boxes work, which box model values to use, and how they affect shape positioning and content flow.

CSS Shapes: Fundamentals

CSS Shapes: Fundamentals

August 20, 2024

CSS Shapes solve a fundamental web layout limitation: content wrapping around custom shapes. Before CSS Shapes, floated elements always created rectangular float areas, preventing content from flowing around circles, polygons, or transparent images. This tutorial explains what CSS Shapes are, how they control content flow without rendering visual shapes, and the core concepts needed to use them effectively.

CSS Shapes: What are They?

CSS Shapes: What are They?

August 19, 2024

CSS Shapes control how content flows around floated elements, but they don't actually render visual shapes—they define float areas. Understanding this distinction is crucial: CSS Shapes determine where content wraps, not what shapes appear on the page. This tutorial explains what CSS Shapes are, how they differ from visual CSS shapes created with borders or clip-path, and why floated elements still create rectangular float areas without the CSS Shapes module.

-->