Skip to main content

Guards

canMatchFeatureFlag

A functional guard that checks whether a route can be activated based on the presence and value of a feature flag in the route's data object.

Usage

export const routes: Route[] = [
{
path: '...',
component: CustomComponent,
data: { featureFlag: 'my-feature' },
canMatch: [ canMatchFeatureFlag ],
},
];
info

In case a feature flag is not detected for a specific Route, and ngx-flagr has been set up to exclude routes without any feature flags, a warning message will be displayed in the console (applicable only in development mode) to notify you which Route could potentially exhibit this unexpected behavior.