This repository was archived by the owner on Dec 19, 2018. It is now read-only.
Tag Helpers: Remove ContentBehavior, replace with single CaptureContentAttribute and put existing functionality on the TagHelperOutput object. #173
Labels
Milestone
Right now
TagHelper
ContentBehavior
is determined based on aContentBehaviorAttribute
and enables you to do ONE of the following:None
,Append
,Prepend
,Replace
andModify
. One limitation of this is that you can only choose one of the four primaryContentBehavior
s (notNone
). The code that Razor generates is behind this limitation.If we remove the
ContentBehaviorAttribute
and replace it with a singleCaptureContentAttribute
which equates to the oldContentBehavior.Modify
we can implementAppend
,Prepend
andReplace
within theTagHelperOutput
object. This enables us to utilize everyContentBehavior
in conjunction with each other.API Suggestion:
Note: Not happy with the naming of the API suggestion, couldn't think of anything better though.
Code Generation Implications:
The only differences would be an
if
statement around theTagHelperOutput
content generation and theGenerateStartTag
=>GenerateStart
(and "end" equivalents) because it now also renders thePreContent
. If we wanted to be explicit instead of renamingGenerateStartTag
toGenerateStart
we could add aGeneratePreContent
method which we'd call into./cc @DamianEdwards
The text was updated successfully, but these errors were encountered: