Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计未展示

angular-formsAngular 表单

Agent Skill

angular-forms 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

432

周安装

18

GitHub Stars

公开资料未说明

下载量

144
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:angular-forms(Angular 表单)
来源仓库:https://github.com/7spade/black-tortoise
仓库路径:skills/angular-forms
安装命令:
npx skills add 7spade/black-tortoise --skill "angular-forms"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add 7spade/black-tortoise --skill "angular-forms"

简介

Angular 表单技能用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境中的关键词或任务场景检索。
  • 通过 npx skills add 命令安装,结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,避免触发联网、命令执行或文件读写。
  • angular-forms 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
angular-forms
description
Angular Reactive Forms for form building, validation, and state management. Use when creating forms, implementing validators, handling form submissions, building dynamic forms, or integrating forms with NgRx Signals in Angular applications. Covers FormControl, FormGroup, and FormArray.
license
Complete terms in LICENSE.txt

Angular Forms Skill

Rules

Form Creation

  • Use ReactiveFormsModule for reactive forms
  • Use FormControl for individual form fields
  • Use FormGroup to group multiple form controls
  • Use FormArray for dynamic lists of form controls
  • Use FormBuilder for simplified form creation

Validation

  • Use built-in validators: Validators.required, Validators.email, Validators.min, Validators.max, Validators.pattern
  • Custom validators MUST return ValidationErrors | null
  • Show validation errors ONLY after field is touched
  • Disable submit button when form is invalid

Form State Management

  • Check form state: valid, invalid, touched, dirty, pristine
  • Reset form using form.reset()
  • Update form values using form.patchValue() or form.setValue()

NgRx Signals Integration

  • Store form instance in signalStore state
  • Use rxMethod for async form submission
  • Use tapResponse for handling submission success/error
  • Reset form on successful submission

Form Submission

  • Use (ngSubmit) event for form submission
  • Validate form before processing: if (form.valid)
  • Handle errors with user feedback

Context

Summary

Angular Reactive Forms provide a model-driven approach to handling form inputs with built-in validation, state management, and integration with Angular's reactive programming patterns.

When to Use This Skill

Activate this skill when you need to:

  • Create reactive forms with FormControl and FormGroup
  • Implement built-in and custom validators
  • Handle form submissions and data binding
  • Build dynamic forms with FormArray
  • Implement cross-field validation
  • Integrate forms with NgRx Signals stores
  • Handle async validators
  • Implement form state management (touched, dirty, valid)
  • Create reusable form components

Basic Reactive Form Example

import { Component } from '@angular/core';
import { ReactiveFormsModule, FormControl, FormGroup, Validators } from '@angular/forms';

@Component({
  selector: 'app-user-form',
  standalone: true,
  imports: [ReactiveFormsModule],
  template: `
    <form [formGroup]="userForm" (ngSubmit)="onSubmit()">
      <input formControlName="name" placeholder="Name">
      @if (userForm.controls.name.touched && userForm.controls.name.errors) {
        <span>Name is required</span>
      }
      
      <input formControlName="email" type="email" placeholder="Email">
      @if (userForm.controls.email.touched && userForm.controls.email.errors?.['email']) {
        <span>Invalid email</span>
      }
      
      <button type="submit" [disabled]="userForm.invalid">Submit</button>
    </form>
  `
})
export class UserFormComponent {
  userForm = new FormGroup({
    name: new FormControl('', [Validators.required]),
    email: new FormControl('', [Validators.required, Validators.email])
  });
  
  onSubmit() {
    if (this.userForm.valid) {
      console.log(this.userForm.value);
    }
  }
}

Custom Validators Example

// Custom validator function
function minAgeValidator(minAge: number): ValidatorFn {
  return (control: AbstractControl): ValidationErrors | null => {
    if (!control.value) return null;
    
    const birthDate = new Date(control.value);
    const age = new Date().getFullYear() - birthDate.getFullYear();
    
    return age >= minAge ? null : { minAge: { required: minAge, actual: age } };
  };
}

// Usage
age: new FormControl('', [Validators.required, minAgeValidator(18)])

Integration with NgRx Signals Example

export const UserFormStore = signalStore(
  { providedIn: 'root' },
  withState({
    form: new FormGroup({
      name: new FormControl(''),
      email: new FormControl('')
    }),
    submitting: false,
    error: null as string | null
  }),
  withMethods((store, userService = inject(UserService)) => ({
    submitForm: rxMethod<void>(
      pipe(
        tap(() => patchState(store, { submitting: true })),
        switchMap(() => userService.createUser(store.form().value)),
        tapResponse({
          next: () => {
            store.form().reset();
            patchState(store, { submitting: false });
          },
          error: (error: Error) => patchState(store, { 
            error: error.message, 
            submitting: false 
          })
        })
      )
    )
  }))
);

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

29.24%
按下载量换算42

OpenCode

22.17%
按下载量换算32

windsurf

19.19%
按下载量换算28

Claude Code

10.99%
按下载量换算16

Codex

8.53%
按下载量换算12

Gemini CLI

3.35%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills