-
Notifications
You must be signed in to change notification settings - Fork 228
Tag Helpers: Add enum attribute support. #196
Comments
See TODO in the MVC repro in ValidationSummaryTagHelper for a string that should be changed to an enum when this is fixed. |
We discussed this again and can't find a reason not to do it and it it's a nice improvement. |
Note: we should also add the |
Agreed |
nit: missing issue tag |
- If a `TagHelper` attribute is an `enum` then you no longer need to provide the `enum` name. To override this functionality you can add the `@` symbol. - Added code generation tests. - Added `TagHelperDescriptorFactoryTest`s that double for Precompilation tests. #196
- Razor `TagHelper`s now special case `enum` values so you don't need to provide the entire `enum` prefix.
- Add new `IsEnum` `TagHelperDescriptor` property to VS compatibility test.
- Add new `IsEnum` `TagHelperDescriptor` property to VS compatibility test.
- If a `TagHelper` attribute is an `enum` then you no longer need to provide the `enum` name. To override this functionality you can add the `@` symbol. - Added code generation tests. - Added `TagHelperDescriptorFactoryTest`s that double for Precompilation tests. #196
- Razor `TagHelper`s now special case `enum` values so you don't need to provide the entire `enum` prefix.
- `TagHelper`s now auto-fill enums. Updated files to reflect new auto-filling enum changes.
- Add new `IsEnum` `TagHelperDescriptor` property to VS compatibility test.
Is it possible to convert enum value names to lower case when used in html? The same way how tags and attributes are converted, so it is more inline with html conventions.
To be used like:
|
@R74NN sorry it is not. The values exposed in the attributes today are pure C# so they must match. If you'd like to work around it in your own implementations you can always have HTML specific enums with lower case names that you interop between. |
It would certainly be possible to modify the code gen to lowercase enum value names. We don't have a great extensibility point for that today, but it might be feasible with a tree rewriter. We could investigate adding some kind of option for this in the future but I think it would likely be part of a more in depth set of features enabling customization of bound property code generation. |
Right now if a
TagHelper
has anEnum
property the user has to type in the fullEnum
value:We can simplify this and make it:
By assuming the
Enum
.The text was updated successfully, but these errors were encountered: