-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
Need clarification on using @ prefix on Razor component's attribute values #34564
Comments
💃🕺🥳 Happy New Year! 🎈🎆🍾🥂🎉Stand-by! ... A green dinosaur 🦖 will be along shortly to assist. |
Thanks for mentioning this, @nicholasyin. We did make a change a couple of years ago, telling devs that we wouldn't generally prefix with WRT ...
That's going to end up being a personal (or organizational) preference on your end. Management (Dan Roth) has decided that we'll not do it in framework test code and documentation examples. Of course, you're welcome to do it in your own apps. The usual recommendation applies: We'd simply suggest that devs be consistent in their choice within an app and even across the apps of their organization. I'll be back in the office ... well ... at my desk 😆 (I'm remote) ... on Monday morning. I'll work on this first thing and resolve it, including adding some context to the article on the subject. I'll ping u on the PR when it goes up. Thanks for the issue! Have a great weekend and Happy New Year! 💃🕺🥳🍾 |
Good morning, @nicholasyin ... I just took a closer look.
That's correct, and the example is correct. This has to do with the type that is assigned to in the I agree with you that the current text isn't good enough to describe this. I'm going to make some updates right now to clear this up. I'll ping u on the PR shortly. Thanks for the issue! ... and Happy New Year! 🕺💃🥳🍾 |
Description
For one thing, the example below doesn't seem to follow the above convention of not using
@
prefix for non-literal variable in attribute values.In addition, I think adding
@
is more reasonable becauseCount="ct"
would intuitively give me the impression thatct
is a regular string assigned toCount
variable.Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-9.0#route-parameters
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/index.md
Document ID
31ad18df-1904-bbdd-cfed-8d0d0267c10e
Article author
@guardrex
Metadata
Related Issues
The text was updated successfully, but these errors were encountered: