ng-config-cat
Version:
An Angular service for ConfigCat
41 lines • 1.5 kB
JavaScript
import { NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NG_CONFIG_CAT_OPTIONS_TOKEN } from './constants/ng-config-cat-options.token';
import { NgConfigCatFeatureEnabledDirective, NgConfigCatFeatureDisabledDirective, } from './directives';
export class NgConfigCatModule {
constructor(parentModule) {
if (parentModule) {
throw new Error('NgConfigCatModule is already loaded. Import it in the AppModule only.');
}
}
static forRoot(ngConfigCatConfiguration) {
return {
ngModule: NgConfigCatModule,
providers: [
{
provide: NG_CONFIG_CAT_OPTIONS_TOKEN,
useValue: ngConfigCatConfiguration
},
],
};
}
}
NgConfigCatModule.decorators = [
{ type: NgModule, args: [{
imports: [
CommonModule,
],
declarations: [
NgConfigCatFeatureEnabledDirective,
NgConfigCatFeatureDisabledDirective,
],
exports: [
NgConfigCatFeatureEnabledDirective,
NgConfigCatFeatureDisabledDirective,
],
},] }
];
NgConfigCatModule.ctorParameters = () => [
{ type: NgConfigCatModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
];
//# sourceMappingURL=ng-config-cat.module.js.map