ConfigCat Public API client for Angular. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.
The client is generated by Swagger Swagger from the ConfigCat Public API.
via NPM package:
npm i ng-configcat-publicapi
In your Angular project:
import { ApiModule } from 'ng-configcat-publicapi';
import { HttpClientModule } from '@angular/common/http';
@NgModule({
imports: [
ApiModule,
// make sure to import the HttpClientModule in the AppModule only,
// see https://github.com/angular/angular/issues/20575
HttpClientModule
],
declarations: [ AppComponent ],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule {}
import { ApiModule, Configuration, ConfigurationParameters } from 'ng-configcat-publicapi';
export function apiConfigFactory (): Configuration => {
const params: ConfigurationParameters = {
// set configuration parameters here.
}
return new Configuration(params);
}
@NgModule({
imports: [ ApiModule.forRoot(apiConfigFactory) ],
declarations: [ AppComponent ],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule {}
import { ProductsService } from 'ng-configcat-publicapi';
export class AppComponent {
constructor(private productsService: ProductsService) { }
getProducts() {
this.productsService.v1ProductsGet().subscribe(products => {
// Do something with the products.
});
}
}