canopy-pipes-kebab-case

Transform strings to kebab-case in Angular templates with Canopy's LgKebabCasePipe.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In Angular templates, inconsistent string formatting can lead to a patchwork of styles. This guide provides best practices for applying the Canopy Kebab Case pipe to convert strings to kebab-case, ensuring uniform UI text across the app.

Core Features & Use Cases

  • Guidance on using the LgKebabCasePipe from @legal-and-general/canopy in Angular templates.
  • Consistency: enforces kebab-case string formatting across components and bindings.
  • Use Case: ideal for transforming labels, routes, and display strings to kebab-case in templates.

Quick Start

Install the Canopy package, import LgKebabCasePipe, and apply the pipe in your Angular templates to transform strings to kebab-case.

Frequently Asked Questions about canopy-pipes-kebab-case

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

FAQPage Schema
How do I convert strings to kebab-case in Angular templates?

You can convert strings to kebab-case in Angular templates by applying the LgKebabCasePipe from the @legal-and-general/canopy package. This enforces consistent kebab-case string formatting across component bindings and display text.

What's the best way to enforce consistent string formatting across Angular components?

Using a dedicated pipe like Canopy's LgKebabCasePipe is a best practice for enforcing consistent string formatting across Angular components. It standardizes labels and routes into kebab-case directly at the template level, preventing style mismatch.

Do I need the Canopy design system to use the LgKebabCasePipe?

Yes, you need the Canopy design system installed. The LgKebabCasePipe requires the @legal-and-general/canopy package, the Angular framework, and proper pipe configuration to function within your frontend project.

Can I use this kebab-case pipe for Angular route formatting?

Yes, applying the LgKebabCasePipe is ideal for transforming route strings and labels into kebab-case within Angular templates. It ensures uniform UI text and route formatting across your application.

How do I set up the Canopy kebab-case pipe in an Angular project?

To set up the Canopy kebab-case pipe, install the @legal-and-general/canopy package, import the LgKebabCasePipe into your Angular module, and apply the pipe operator within your template HTML to transform strings.

When should I avoid using a template pipe for string transformation?

You should avoid template pipes for string transformation if your project does not use the Angular framework or the @legal-and-general/canopy UI component library, as the LgKebabCasePipe depends on this specific tech stack.