Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate Microsoft.AspNetCore.Razor.TagHelpers #179

Open
leotsarev opened this issue Oct 22, 2019 · 1 comment
Open

Annotate Microsoft.AspNetCore.Razor.TagHelpers #179

leotsarev opened this issue Oct 22, 2019 · 1 comment
Assignees

Comments

@leotsarev
Copy link
Contributor

In particular, please add [MeansImplicitUse] to HtmlTargetElement and HtmlAttributeName

@leotsarev
Copy link
Contributor Author

Sample code:

    [HtmlTargetElement("button")]
    public class ConditionalDisableTagHelper : TagHelper
    {
        [HtmlAttributeName("asp-is-disabled")]
        public bool IsDisabled { set; get; }

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            if (IsDisabled)
            {
                var d = new TagHelperAttribute("disabled", "disabled");
                output.Attributes.Add(d);
            }
            base.Process(context, output);
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants