canopy-forms-sort-code

Validate UK sort codes in Canopy Angular forms using the lgSortCode directive.

23|46|Updated Sep 7, 2020
One-click install
npx skills add https://github.com/Legal-and-General/canopy --skill canopy-forms-sort-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canopy-forms-sort-code
Source: https://github.com/Legal-and-General/canopy/tree/main/skills/best-practice/forms-sort-code
Command: npx skills add https://github.com/Legal-and-General/canopy --skill canopy-forms-sort-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Canopy Sort Code best-practices guide helps developers reliably capture and validate UK bank sort codes in Angular forms, ensuring consistent formatting and correct validation behavior.

Core Features & Use Cases

  • Clear guidance for using the lgSortCode directive with lgInput and exact hint text to enforce correct input formats.
  • Automatic formatting to 00-00-00 on blur for user-entered sort codes and robust validation of allowable patterns (000000, 00 00 00, 00-00-00).
  • Designed to work with Canopy reactive forms in real-world forms such as checkout or user registration to prevent invalid entries.
  • Guidance on error messaging and integration with the forms-validation skill for showing validation feedback.

Quick Start

Use the Canopy sort-code directive on your input field and bind it to a reactive form control with the exact hint text.

Frequently Asked Questions about canopy-forms-sort-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate a UK sort code in Angular reactive forms?

To validate a UK sort code in Angular reactive forms, apply the Canopy lgSortCode directive alongside lgInput on your input field, which enforces allowable patterns like 00-00-00 and 000000 to prevent invalid entries.

What is the best way to format UK sort codes on blur in Angular?

The best way to format UK sort codes on blur in Angular is using the Canopy lgSortCode directive, which automatically converts user-entered values into the standard 00-00-00 format when the input field loses focus.

Does the Canopy lgSortCode directive support multiple sort code input patterns?

Yes, the Canopy lgSortCode directive supports multiple input patterns, validating allowable formats including 000000, 00 00 00, and 00-00-00 to accommodate varied user entry behaviors in reactive forms.

How do I integrate sort code error messaging with Angular form validation?

You integrate sort code error messaging by combining the lgSortCode directive with the Canopy forms-validation skill, which handles displaying reactive form validation feedback for invalid UK sort code entries.

Can I use the lgSortCode directive for checkout and user registration forms?

Yes, you can use the lgSortCode directive for checkout and user registration forms, as it is specifically designed to work with Canopy reactive forms in real-world scenarios to reliably capture and validate UK bank sort codes.