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

Docs for the Component Tag Helper (or how to send a string parameter) #17160

Closed
mrlife opened this issue Feb 29, 2020 · 6 comments · Fixed by #17343
Closed

Docs for the Component Tag Helper (or how to send a string parameter) #17160

mrlife opened this issue Feb 29, 2020 · 6 comments · Fixed by #17343
Assignees
Labels
Blazor doc-idea Pri1 High priority, do before Pri2 and Pri3 Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects

Comments

@mrlife
Copy link
Contributor

mrlife commented Feb 29, 2020

[EDIT by guardrex to note that this issue can be worked with #17210]

I'm unable to find the docs for the Component Tag Helper, i.e. <component>. I'm trying to send a string as a parameter but getting a build error. I know you can send an integer, per this page of the docs, but I can only send a string if it's in a variable. Here is the code and error.

Code

<component type="typeof(ColorfulCheckbox)"
	   render-mode="Server"
	   param-Color="blue" />

Error

The name 'blue' does not exist in the current context (CS0103)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@dotnet-bot dotnet-bot added ⌚ Not Triaged Blazor Source - Docs.ms Docs Customer feedback via GitHub Issue labels Feb 29, 2020
@guardrex
Copy link
Collaborator

guardrex commented Feb 29, 2020

Hello @mrlife ... You're saying that it will work if you add an int prop to the component and assign to that (as the example shows) but as soon as you try a string prop it fails? Let's just rule out the possibility that this is a namespace problem. If it works for an int but not a string, then we'll go to engineering with this; but if they both don't work, then troubleshoot it as a namespace issue.

btw ...

unable to find the docs for the Component Tag Helper

You found 'um! 😄 ... We'll add to/modify these instructions as reports come in and indicate needed changes. If this turns out to be a namespace issue, then we can address that in this text.

@guardrex guardrex self-assigned this Feb 29, 2020
@guardrex guardrex added this to the Backlog milestone Feb 29, 2020
@guardrex guardrex added this to Triage in Blazor.Docs via automation Feb 29, 2020
@mrlife
Copy link
Contributor Author

mrlife commented Feb 29, 2020

Hi @guardrex

You're saying that it will work if you add an int prop to the component and assign to that (as the example shows) but as soon as you try a string prop it fails?

Yes, that's what I'm seeing... The assignment of 10 like in the example works because it is numeric. If I add any characters, it throws the error.

If it works for a string but not an int then we'll go to engineering with this; but if they both don't work, then troubleshoot it as a namespace issue.

Never works for raw string but raw int works fine.

Also, would it be worthwhile to have a page in the docs that provides the details of the Component Tag Helper?

@guardrex
Copy link
Collaborator

In reverse order ...

Yes, I agree on that ... in the TH section of the TOC as a built-in TH. I can cross-link from here to there and place the additional content there on whatever this turns out to be.

WRT the error, open an issue with engineering ...

  • https://github.com/dotnet/aspnetcore/issues
  • Add a cc: @guardrex to the bottom of your issue so that I can track along.
  • Leave this open. I'll work it when we get an answer over there, and I'll use this to track our visibility of the TH. Thanks for the suggestion @mrlife! 🎷

@guardrex guardrex added doc-idea Pri2 Priority 2 labels Feb 29, 2020
@guardrex guardrex moved this from Triage to P2 - Medium Priority in Blazor.Docs Feb 29, 2020
@guardrex guardrex modified the milestones: Backlog, 2020 Q1 ends Mar 31 Feb 29, 2020
@guardrex guardrex added Pri1 High priority, do before Pri2 and Pri3 and removed Pri2 Priority 2 labels Feb 29, 2020
@guardrex guardrex moved this from P2 - Medium Priority to P0/P1 - High Priority in Blazor.Docs Feb 29, 2020
@mrlife
Copy link
Contributor Author

mrlife commented Feb 29, 2020

Great thanks, here is the direct link to the issue: dotnet/aspnetcore#19466

@guardrex
Copy link
Collaborator

guardrex commented Feb 29, 2020

Note to self: Add the Blazor label for this topic to .ghal.rules.json when this issue is worked ...

"(?i).*master\/aspnetcore\/mvc\/views\/tag-helpers\/built-in\/component.md": {
  "labels-add": "Blazor"
},

@guardrex
Copy link
Collaborator

Now, we know! 💡 ... I'll update and work on a Component TH topic asap. It will be perhaps 1-2 weeks due to high priority Blazor issues.

@guardrex guardrex moved this from P0/P1 - High Priority to In progress in Blazor.Docs Mar 17, 2020
Blazor.Docs automation moved this from In progress to Done Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blazor doc-idea Pri1 High priority, do before Pri2 and Pri3 Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
Archived in project
Blazor.Docs
  
Done
3 participants