Comments (9)
@guardrex The other errors are unrelated and can be ignored. Thanks for fixing this!
from blazor.docs.
I just have found probably another misprint on the page, section Component attributes.
@guardrex is it suitable to report this inside this issue? It looks like consistent.
Child component:
<div> ... </div>
@functions {
public int Year { get; set; }
public Action<int> ValueChanged { get; set; }
}
Actually, the second property's name should be YearChanged. In other case, there is a corresponding error message in a browser's console:
Uncaught (in promise) Error: System.InvalidOperationException: Object of type 'WebApplication1.Pages.ChildComponent' does not have a property matching the name 'YearChanged'.
from blazor.docs.
@guardrex thank you for the fix!
from blazor.docs.
Thanks @ivryakhov!
Yes, thank you for reporting ... I'll take a look at this in a couple of hours and get it fixed fast.
from blazor.docs.
Thanks again @ivryakhov for reporting. I fixed it in two spots (in the sample code and in the sample markup that explains the code).
@SteveSandersonMS I was surprised that it broke because I incorrectly assumed that ChildComponent.cshtml could have its RenderFragement
property be named anything. Does the name of the property need to pair with the name of the component?
I understand the first pair ...
<ChildComponent ... /> 👉 ChildComponent.cshtml 👉 ChildContent RenderFragment
... is the second pair also a convention? If so, then I'll flesh that fact out more in the topic.
from blazor.docs.
The name of the parameter that receives child content is always ChildContent
, regardless of the name of anything else. If people don't like this convention we might change it, but this is how it is today.
from blazor.docs.
The name of the parameter that receives child content is always ChildContent, regardless of the name of anything else.
Ahhhh! Ok ... I'll make that explicit in the topic. I'll ping u on the PR.
from blazor.docs.
Great! @guardrex thank you for the document update.
from blazor.docs.
@ivryakhov Great 👁️!
That came from the blog post: https://blogs.msdn.microsoft.com/webdev/2018/04/17/blazor-0-2-0-release-now-available/#binding-to-components
... and there is one line under the example that I didn't address in the topic example ...
The
Value
parameter is bindable because it has a companionValueChanged
event that matches the type of theValue
parameter.
I've made a commit to the PR to change it to YearChanged
. I also took Steve's line and added it to this section of the topic.
from blazor.docs.
Related Issues (20)
- Translate documentation to [pt-br] HOT 2
- Update JS interop to document appropriate use of IJSRuntime with server-side Blazor HOT 1
- Add new sample (Blazor Paint)
- 404 on Get Started :( HOT 1
- Request for new entry in Book section HOT 6
- Add the TabSet example in sample app
- Update Blazor hosting models topic for 0.7.0
- Update Host and deploy for 0.7.0 HOT 1
- Component input validation HOT 5
- Add the doc for bind-property-event syntax HOT 4
- Explain the difference between for and foreach loop in context of lambda expression HOT 4
- Add new sample (Blazor Excel) HOT 11
- Add new sample and library (WebSocket)
- Add section about what is and how to create dynamic components HOT 4
- Broken API link
- Getting started with Blazor - documentation incorrect HOT 3
- Razor Components + EF Core HOT 1
- Redirects
- "What is Blazor" link is broken
- Redirection to newer getting started tutorial HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazor.docs.