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 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.

CSS Shapes: Introduction

CSS Shapes: Introduction

August 19, 2024

Web layouts have been trapped in rectangular boxes for decades, limiting designers to grid-based structures that can't match the creative freedom of print design. CSS Shapes changes everything by allowing content to flow around custom shapes, creating magazine-style layouts with text wrapping around circles, polygons, and custom paths. This comprehensive guide teaches you how to break free from rectangular constraints and build sophisticated, editorial-style layouts that were previously impossible on the web.

Angular Slide Animation: Slide-in/Slide-out Effects (Deprecated Module)

Angular Slide Animation: Slide-in/Slide-out Effects (Deprecated Module)

August 16, 2024

Slide-in and slide-out animations are essential for modals, sidebars, and dynamic content, creating smooth transitions that guide user attention. While CSS transitions work for simple show/hide scenarios, Angular's animation framework provides better control over timing, easing, and coordination with component lifecycle. This tutorial demonstrates how to create professional slide animations using Angular's animation framework. Note: This uses Angular's deprecated animations module—modern alternatives are available.

Angular effect(): React to Signal Changes with Side Effects (v19+)

Angular effect(): React to Signal Changes with Side Effects (v19+)

August 01, 2024

Reacting to signal changes for side effects like logging, API calls, or DOM manipulation requires a different approach than computed signals, which are read-only and template-focused. Angular's effect() function executes code when signals change, making it perfect for debugging, analytics, and imperative operations that can't be handled in templates. This tutorial demonstrates when and how to use effect() effectively, while also covering when NOT to use it (see the linked tutorial for common mistakes).

Angular computed(): Create Derived Signals from Other Signals (v19+)

Angular computed(): Create Derived Signals from Other Signals (v19+)

August 01, 2024

Derived state is common in Angular applications—calculating totals from item prices, formatting dates from timestamps, or combining multiple signals into a single computed value. Angular's computed() function creates reactive, memoized signals that automatically update when their dependencies change, eliminating the need for manual subscriptions and improving performance. This tutorial demonstrates how to use computed() to create derived signals that stay in sync with their sources.

3 Ways to Add Dynamic CSS Custom Properties in Angular

3 Ways to Add Dynamic CSS Custom Properties in Angular

July 25, 2024

Dynamic CSS custom properties enable data-driven styling in Angular components, allowing you to create responsive charts, themed components, and dynamic layouts based on runtime values. Angular provides multiple ways to set custom properties programmatically, each with different use cases and trade-offs. This tutorial compares three approaches: template style binding, Renderer2's setStyle method, and host element binding, helping you choose the right method for your scenario.

Angular @let Template Variables: Create Variables in Templates (v17+)

Angular @let Template Variables: Create Variables in Templates (v17+)

July 19, 2024

Angular's @let syntax allows you to create variables directly in templates, eliminating the need for component properties for simple calculations and transformations. Template variables improve readability, reduce component complexity, and enable inline computations without cluttering your TypeScript code. This tutorial demonstrates how to use @let for string manipulation, computed values, conditional logic, and accessibility improvements, showing real-world examples that simplify your templates.

Angular Custom Loading Screen: Replace Blank Bootstrap Screen

Angular Custom Loading Screen: Replace Blank Bootstrap Screen

July 05, 2024

Blank screens during Angular app bootstrap create poor first impressions and make applications feel slow, even when they're loading quickly. Custom loading screens improve perceived performance, provide visual feedback, and enhance brand consistency. This tutorial shows you how to replace Angular's default blank bootstrap screen with a custom loading animation that displays while your app initializes. Note: This uses Angular's deprecated animations module—modern alternatives are available.

Angular Host Element Binding: Replace @HostBinding and @HostListener (v19+)

Angular Host Element Binding: Replace @HostBinding and @HostListener (v19+)

July 05, 2024

Angular's @HostBinding and @HostListener decorators are deprecated, existing only for backwards compatibility. Modern Angular uses host element bindings in the component decorator and host event bindings in templates, providing better type safety, clearer syntax, and improved performance. This tutorial demonstrates how to migrate from deprecated decorators to modern host binding patterns, updating real-world examples and modernizing component code along the way.

Angular CDK Auto-Resizing Textareas: Dynamic Height Control

Angular CDK Auto-Resizing Textareas: Dynamic Height Control

June 28, 2024

Fixed-height textareas create poor user experiences when content exceeds the visible area, forcing users to scroll within a small box. Auto-resizing textareas improve UX by expanding to fit content, eliminating scrollbars, and providing visual feedback as users type. The Angular CDK TextField module includes a directive that handles all the complexity of auto-resizing textareas, including proper height calculations and performance optimizations. This tutorial shows you how to implement auto-resizing textareas in minutes.