question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs: Property binding and string initialization, small possible improvements

See original GitHub issue

Description

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:

Screenshot at 2021-08-30 14-21-50 Screenshot at 2021-08-30 14-14-34

So I would think it would be good to amend such docs/examples.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
gkalpakcommented, Sep 9, 2021

No worries, @dario-piotrowicz 😃

If some code is not used/needed, feel free to remove it. Let’s move the discussion to the PR 😉

1reaction
dario-piotrowiczcommented, Aug 30, 2021

Awesome, I’ll make the changes then, thanks 😃

( if I could be assigned to this issue that would be great 😃 )

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found