Docs: Property binding and string initialization, small possible improvements
See original GitHub issueDescription
In the property binding docs, there is a section about one-time string initialization which simply states that the square brackets for property binding are not to be used for simple strings defined in the template
as in:
<app-string-init prefix="This is a one-time initialized string."></app-string-init>
instead of:
<app-string-init [prefix]="'This is a one-time initialized string.'"></app-string-init>
and it says that this should be done (not could), so I was just thinking that this could be added to the property binding best practices page (something like “Avoid unnecessary expression evaluations”, which could refer to the section I mentioned on top of the issues’s description)
I’ve also found that a few places in the docs do not follow this, as for example:
So I would think it would be good to amend such docs/examples.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Layouts and binding expressions | Android Developers
This class holds all the bindings from the layout properties (for example, the user variable) to the layout's views and knows how to...
Read more >Property '...' has no initializer and is not definitely assigned in ...
It is because TypeScript 2.7 includes a strict class checking where all the properties should be initialized in the constructor.
Read more >Understanding Angular property binding and interpolation
Property binding : Property binding is a one-way mechanism that lets you set the property of a view element. It involves updating the...
Read more >What's New in EF Core 7.0 - Microsoft Learn
EF7 contains a variety of small improvements to DbContext and related classes. Tip. The code for samples in this section comes from ...
Read more >Effective Dart: Usage
DO initialize fields at their declaration when possible. ... DO use initializing formals when possible. DON'T use late when a constructor initializer list...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No worries, @dario-piotrowicz 😃
If some code is not used/needed, feel free to remove it. Let’s move the discussion to the PR 😉
Awesome, I’ll make the changes then, thanks 😃
( if I could be assigned to this issue that would be great 😃 )