Index of every page on this site: llms.txt
All skills
abiramcodes avatar

/angular-developer

@5863679
by Abiramabiramcodes/ng-point9 stars
Run it yourself

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, services, or HTTP communication, or for best practices on reactivity (signals, linkedSignal, resource, httpResource), queries and content projection, forms, dependency injection, routing, server and hybrid rendering (SSR, prerendering, hydration), accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, naming conventions, or CLI tooling.

  • 45 files
  • 180.7 KB
  • MIT
  • Updated 2 days ago
  • GitHub
Use this Skill: https://skilld.dev/gh/abiramcodes/ng-point/angular-developer

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceslinked-signal.md

≈833 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Dependent State with linkedSignal

The linkedSignal function lets you create writable state that is intrinsically linked to some other state. It is perfect for state that needs a default value derived from an input or another signal, but can still be independently modified by the user.

If the source state changes, the linkedSignal resets to a new computed value.

Basic Usage

When you only need to recompute based on a source, pass a computation function. linkedSignal works like computed, but the resulting signal is writable (you can call .set() or .update() on it).

import { Component, signal, linkedSignal } from '@angular/core';

@Component({...})
export class ShippingMethodPicker {
  protected readonly shippingOptions = signal(['Ground', 'Air', 'Sea']);

  // Defaults to the first option.
  // If shippingOptions changes, selectedOption resets to the new first option.
  protected readonly selectedOption = linkedSignal(() => this.shippingOptions()[0]);

  changeShipping(index: number) {
    // We can still manually update this signal!
    this.selectedOption.set(this.shippingOptions()[index]);
  }
}

Advanced Usage: Accounting for Previous State

Sometimes, when the source state changes, you want to preserve the user's manual selection if it is still valid. To do this, use the object syntax providing source and computation.

The computation function receives the new value of the source, and a previous object containing the previous source value and the previous linkedSignal value.

interface ShippingMethod { id: number; name: string; }

@Component({...})
export class ShippingMethodPicker {
  protected readonly shippingOptions = signal<ShippingMethod[]>([
    {id: 0, name: 'Ground'}, {id: 1, name: 'Air'}, {id: 2, name: 'Sea'}
  ]);

  protected readonly selectedOption = linkedSignal<ShippingMethod[], ShippingMethod>({
    source: this.shippingOptions,
    computation: (newOptions, previous) => {
      // If the newly loaded options still contain the user's previously
      // selected option, keep it selected. Otherwise, reset to the first option.
      return newOptions.find(opt => opt.id === previous?.value.id) ?? newOptions[0];
    }
  });
}

Customizing the set Operation

By default, calling .set() on a linkedSignal updates its internal value directly. To write back to the source of truth instead, pass a set function in the options. It receives the new value plus a rawSet function that applies the default behavior directly (useful to skip the computation when it is expensive and you already know the result).

const tempC = signal(0);
// tempF.set() writes back to tempC instead of only updating tempF
const tempF = linkedSignal(() => (tempC() * 9) / 5 + 32, {
  set: (valF) => tempC.set(((valF - 32) * 5) / 9),
});

tempF.set(212); // tempC() is now 100, tempF() re-derives to 212

When to use linkedSignal vs computed vs effect

  • Use computed: When state is strictly derived from other state and should never be manually updated.
  • Use linkedSignal: When state is derived from other state, but the user must be able to override or manually update it.
  • Never use effect to sync one piece of state to another. That is an anti-pattern. Use computed or linkedSignal instead.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 5863679. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 10 hours ago.

Activeupdated 2 days ago
Other metadata
metadata
{
  "author": "Copyright 2026 Google LLC",
  "version": "1.0",
  "internal": true
}

README badge

README badge for abiramcodes/ng-point/angular-developer