Skip to content

Instantly share code, notes, and snippets.

@mts88
Created November 11, 2021 20:23
Show Gist options
  • Save mts88/cf5d7c71d3a7aa951cfdaeef2869bd65 to your computer and use it in GitHub Desktop.
Save mts88/cf5d7c71d3a7aa951cfdaeef2869bd65 to your computer and use it in GitHub Desktop.
Feature Flag Usage
import { Component, OnInit } from '@angular/core';
import { FeatureFlagService } from 'src/app/shared/services/feature-flag.service';
@Component({
selector: 'app-image',
templateUrl: 'image.component.html',
styles: [],
})
export class ImageComponent implements OnInit {
constructor(private readonly featureFlagService: FeatureFlagService) {}
ngOnInit(): void {
if (this.featureFlagService.isEnabled('image_tagging')) {
// Do something
} else {
// Do something else
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment