angular-patterns

A reference guide to Angular 22 and newer coding patterns, including signals, effects, component structure, and lifecycle features.

In plain words
What is it for?
Use it when building or reviewing Angular components, especially when choosing inputs, outputs, derived state, event handling, host bindings, or member order.
Why use it?
It gives developers concrete rules and examples for writing Angular code that matches the project's conventions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/sap/fundamental-ngx/angular-patterns
Clone the repo
git clone --depth 1 https://github.com/SAP/fundamental-ngx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,847 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03847
Opus 5 $0.00000 $0.01924
Sonnet 5 $0.00000 $0.00769
Haiku 4.5 $0.00000 $0.00385

Measured yesterday against content hash 43df71639741, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

angular-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/agents/angular-patterns.md · 661 lines

How it starts

The opening of the file, as written. The whole thing — 661 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Angular 22+ Patterns - Detailed Reference

This document provides detailed patterns and examples for Angular 22+ development in the Fundamental NGX project.

Table of Contents


Signal Inputs, Outputs, and Models

input() - Read-only signal inputs

// Optional with default value
readonly name = input<string>('');

// Required input (throws if not provided)
readonly id = input.required<string>();

// With transform function
readonly count = input(0, { transform: numberAttribute });
readonly disabled = input(false, { transform: booleanAttribute });

// Reading the value (call like a function)
const currentName = this.name();

output() - Event emitters

// Define outputs
readonly clicked = output<MouseEvent>();
readonly valueChange = output<string>();
readonly closed = output<void>();

// Emit events
this.clicked.emit(event);
this.valueChange.emit('new value');
this.closed.emit();

model() - Two-way binding

// Optional with default
readonly value = model<number>(0);

// Required model
readonly selected = model.required<boolean>();

// Update model value
this.value.set(10);
this.value.update(v => v + 1);

// In parent template:
<child [(value)]="parentValue" />

Computed Signals

Basic Usage

protected readonly fullName = computed(() =>
    `${this.firstName()} ${this.lastName()}`
);

// Multiple dependencies
protected readonly total = computed(() =>
    this.price() * this.quantity()
);

Read the full file on GitHub · 661 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 661 lines · 0 tokens per session scan A 43df71639741

Subscribe to this mod's changes

angular-patterns is an agent published in the GitHub repository SAP/fundamental-ngx (294 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,847 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.