Skip to content

Commit 96819bb

Browse files
Add negating feature tag helper explanation to readme (#274)
* add negating feature tag evaluation section to readme * reword last sentence * fix ordering and consolidate sections for readability
1 parent a7e5b90 commit 96819bb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,14 @@ In MVC views `<feature>` tags can be used to conditionally render content based
256256
</feature>
257257
```
258258

259+
You can also negate the tag helper evaluation to display content when a feature or set of features are disabled. By setting `negate="true"` in the example below, the content is only rendered if `FeatureX` is disabled.
260+
261+
``` HTML+Razor
262+
<feature negate="true" name=@nameof(MyFeatureFlags.FeatureX)>
263+
<p>This can only be seen if 'FeatureX' is disabled.</p>
264+
</feature>
265+
```
266+
259267
The `<feature>` tag requires a tag helper to work. This can be done by adding the feature management tag helper to the _ViewImports.cshtml_ file.
260268
``` HTML+Razor
261269
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore

0 commit comments

Comments
 (0)