feature-toggle-client-lib v0.1.0
FeatureToggleClientLib
This library was generated with Angular CLI version 12.1.0.
Using It
On app.module:
import { FeatureTogggleClientConfig, FeatureToggleClientModule, FeatureToggleClientService } from 'feature-toggle-client-lib';
const config: FeatureTogggleClientConfig = { apiUrl:"https://localhost:5001", environmentName:"dev1", refreshIntervalInSeconds:30, showLogs: false };
To Force the application starts with loading the first version of the Features
Remove the AutoBootstrap of the app
//bootstrap: AppComponent
On Class AppModule
constructor(private featureToggle: FeatureToggleClientService) {
}
public ngDoBootstrap(ref: ApplicationRef) { this.featureToggle.Initialize().toPromise().then(() => { ref.bootstrap(AppComponent); }); }
Checking if a Feature is enabled:
this.resultFeature = this.featureToggle.isEnabled("Feature_E");
Build
Run ng build feature-toggle-client-lib
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build feature-toggle-client-lib
, go to the dist folder cd dist/feature-toggle-client-lib
and run npm publish
.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago