Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
App init service for loading feature flags
@Injectable({
providedIn: 'root'
})
export class AppInitService {
constructor(private httpClient: HttpClient, private featureToggleService: FeatureToggleService) {}
public init() {
return this.httpClient
.get('assets/feature-config.json')
.pipe(tap((features) => (this.featureToggleService.features = features as any)))
.toPromise();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.