ngx-feature-toggle-demo
Version:
Your module to handle with feature toggles in Angular applications easier.
36 lines (32 loc) • 1.18 kB
HTML
<a href="https://github.com/willmendesneto/ngx-feature-toggle">
<h1>ngx-feature-toggle</h1>
</a>
{{ featureToggleData | json }}
<feature-toggle-provider [features]="featureToggleData">
<div *featureToggle="'enableSecondText'">
<p>condition is true and "featureToggle" is enabled.</p>
</div>
<div *featureToggle="'enableFirstText'">
<p>
condition is false and "featureToggle" is disabled. In that case this
content should not be rendered.
</p>
</div>
<div *featureToggle="'!enableFirstText'">
<p>
condition is false and "featureToggle" is disabled
<b>but it has "!" as a prefix of the feature toggle to be checked.</b> In
that case this content should be rendered.
</p>
</div>
<div *featureToggle="['enableSecondText', '!enableFirstText']">
<p>
This is a combined condition. It shows if <b>enableSecondText</b> is true
and <b>enableFirstText</b> is <b>falsy</b>. If both cases are correct,
then the "featureToggle" is enabled and rendering this component.
</p>
</div>
<div *featureToggle="'enableFirstText'">
<app-hello name="Oops"></app-hello>
</div>
</feature-toggle-provider>