Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(query): fix provider dependencies for local env using feature-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshiGupta authored and sudsen committed Aug 17, 2018
1 parent 27db8f6 commit e569abf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/components_ngrx/planner-query/planner-query.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { NgModule } from '@angular/core';
import { PlannerQueryRoutingModule } from './planner-query-routing.module';
import { PlannerQueryComponent } from './planner-query.component';

import { FeatureFlagResolver, FeatureTogglesService } from 'ngx-feature-flag';
import { togglesApiUrlProvider } from '../../shared/toggles-api.provider';

@NgModule({
imports: [
CommonModule,
Expand All @@ -13,6 +16,9 @@ import { PlannerQueryComponent } from './planner-query.component';
],
exports: [
PlannerQueryComponent
],
providers: [
FeatureFlagResolver, FeatureTogglesService, togglesApiUrlProvider
]
})
export class PlannerQueryModule { }
12 changes: 12 additions & 0 deletions src/app/shared/toggles-api.provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { InjectionToken } from '@angular/core';
import { FABRIC8_FEATURE_TOGGLES_API_URL } from 'ngx-feature-flag';

let witApiUrlFactory = () => {
return process.env.FABRIC8_WIT_API_URL;
};

// for now use wit proxy for toggles-services
export let togglesApiUrlProvider = {
provide: FABRIC8_FEATURE_TOGGLES_API_URL as InjectionToken<string>,
useFactory: witApiUrlFactory
};

0 comments on commit e569abf

Please sign in to comment.