Skip to content

Instantly share code, notes, and snippets.

@kasunkv
Created January 16, 2020 15:59
Show Gist options
  • Save kasunkv/755f78acea7a217646a6966089d05154 to your computer and use it in GitHub Desktop.
Save kasunkv/755f78acea7a217646a6966089d05154 to your computer and use it in GitHub Desktop.
Using feature tag helper to wrap UI elements to hide behind feature flags
@model HomeViewModel
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<feature name="@Features.PromotionDiscounts" negate="true"><h1 class="display-4">Enjoy the latest music from your favorite artist</h1></feature>
<feature name="@Features.PromotionDiscounts"><h1 class="display-4">Enjoy 25% off for selected albums from your favorite artist</h1></feature>
...
<feature name="@Features.UserSuggestions">
<partial name="_UserSuggestionsPartial" model="@Model.Suggestions" />
</feature>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment