Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created July 31, 2019 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/d716b102c3d5558a240b3e331cccd634 to your computer and use it in GitHub Desktop.
Save NetanelBasal/d716b102c3d5558a240b3e331cccd634 to your computer and use it in GitHub Desktop.
<div *featureFlag="'a' or 'c'">...</div>
export class FeatureFlagDirective {
@Input() featureFlag: string | string[];
@Input() featureFlagOr: string = '';
...
ngOnInit() {
if (this.userQuery.hasFlags(this.featureFlag) ||
this.userQuery.hasFlags(this.featureFlagOr)
) {
this.vcr.createEmbeddedView(this.tpl);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment