canopy-feature-toggle

Manage feature flag visibility in Angular Canopy projects via directives and guards.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manage feature flag visibility and guarded routes in Angular Canopy projects to reduce risk during rollout.

Core Features & Use Cases

  • Enables root-level configuration with forRoot to supply an observable feature map.
  • Provides the lgFeatureToggle structural directive to conditionally render UI.
  • Applies FeatureToggleGuard to protect routes and lazy-loaded modules based on feature flags.

Quick Start

Install and configure LgFeatureToggleModule in your root module and apply the lgFeatureToggle directive to conditionally render content.

Frequently Asked Questions about canopy-feature-toggle

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

FAQPage Schema
How do I manage feature flag visibility in Angular Canopy projects?

Manage feature flag visibility in Angular Canopy projects by configuring LgFeatureToggleModule with forRoot to supply an observable feature map, and using the lgFeatureToggle directive to conditionally render UI elements based on those flags.

How do I protect Angular routes using feature flags?

Protect Angular routes by applying FeatureToggleGuard to restrict access based on feature flags, utilizing per-route featureFlag data to secure routes and lazy-loaded modules during incremental feature rollouts.

Can I hide UI elements by default when a feature flag is missing in Angular?

Yes, you can hide UI elements by default using the defaultHide behavior within LgFeatureToggleModule, ensuring that structural directives safely restrict visibility unless a feature flag explicitly enables the content.

What is the best way to conditionally render UI components with feature flags in Angular?

The best way to conditionally render UI components with feature flags in Angular is using the lgFeatureToggle structural directive, which evaluates the observable feature map supplied via forRoot to safely show or hide elements.

Does LgFeatureToggleModule support lazy-loaded Angular modules?

Yes, LgFeatureToggleModule supports lazy-loaded Angular modules by combining FeatureToggleGuard with per-route featureFlag data, allowing fine-grained access control over dynamically loaded application sections.