Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Auto Attribute removal in TagHelpers #247

@yishaigalatzer

Description

@yishaigalatzer

Attributes that in normal razor code gets automatically removed gets special treatment with TagHelpers.

  1. Only attributes that are not bound to tag helper properties will keep the existing razor behavior.
  2. These attributes will generate the "naive" string and populate the TagHelperContext.AllAttributes
  3. Expression Values that are result in false, null or string.Empty are stripped from TagHelperOutput.Attributes.
    1. Example input:
      1. TagHelperContext.AllAttributes will include [class, "false"]
      2. TagHelperOutput.Attributes will not include class.
    2. For other examples follow unit tests for WriteAttribute.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions