Support creating Tag Helpers using CSHTML files
Just an initial idea:
RepeatTagHelper.cshtml
@tagHelper "repeat"
@class {
[HtmlAttributeName("repeat")]
public int Repeat { get; set; }
}
@{
output.TagName = null;
}
@for (var i = 0; i < Repeat; i++) {
@await output.GetChildContentAsync(useCachedValue: false)
}
public int Repeat { get; set; }?
Doh, typo
This is a very cool one, perhaps it's very handy if we support it too in the "Razor Pages", because it's kind of Razor Helpers that we know and love
Yep, this would of course work with the pages stuff too.
Can we use @functions instead of @class because the block already allow us to declare properties
It's too thin of a veneer, IMO. So for people that know tag helpers, why not just code in C#. For those that don't already know how tag helpers work, there's too much magic here.
Wouldn't that essentially be the same functionality as a ViewComponent?
Moving to the backlog, this is not planned for 2.0.0-preview1.