0.0.2 • Published 5 years ago
@vidisha444/featureflags v0.0.2
Installation
Install in your Angular project using
npm i @vidisha444/featureflagImport in your app.module.ts
import { FeatureflagModule } from 'featureflag';And in your imports array (where the path of the config.json can be any path of json file even present on the web)
FeatureflagModule.forRoot('./assets/config/config.json')Eg of config.json file ->
{
"feature1": false,
"feature2": true,
"feature3": false
}Implementation of Feature Flags in Angular
There can be 2 ways to turn on/off any screen or tile or section 1. Through routing 2. Through directly not showing the section or tile
- Using Routing
Just add this to any route in your routing path->
canLoad: [FeatureFlagGuard], data: {feature: 'feature1'}- For sections or tiles
Just add *featureFlag=" 'feature2'" in any div or section or card.
0.0.2
5 years ago