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.

[Angular] Respect --no-bracket-spacing for interpolations

See original GitHub issue

Some might disagree that this should be added, but (possibly unfortunately) the option --no-bracket-spacing already exists. Respecting it would, in my opinion, make a code base more consistent.

JSX also seems to ignore this option, although in its case no spaces are added (an issue was opened and closed regarding this: #1097). Why no spaces for JSX but spaces in Angular? I suppose that people don’t really use Angular together with JSX so there shouldn’t be any inconsistency there, but still, why the inconsistency in terms of decisions (space vs. no space)?

Prettier 1.15.2 Playground link

--parser angular
--no-bracket-spacing

Input:

<div> {{   x + 2}}   </div>

Output:

<div>{{ x + 2 }}</div>

Expected behavior:

<div>{{x + 2}}</div>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lydellcommented, Nov 14, 2018

Same request but for JSX: #2651

1reaction
lydellcommented, Nov 26, 2020

It’s been 2 years with just 1 👍. Time to close.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Displaying values with interpolation - Angular
Interpolation refers to embedding expressions into marked up text. By default, interpolation uses the double curly braces {{ and }} as delimiters.
Read more >
Alternative (square bracket) syntax - Apache FreeMarker Manual
The square bracket and the default (angle bracket) syntax are mutually exclusive within a template; they can't be mixed. If the template uses ......
Read more >
What is Interpolation in AngularJS ? - GeeksforGeeks
In this article, we will know about Interpolation in AngularJS, along with understanding the basic implementation. In AngularJS ...
Read more >
Understanding Angular property binding and interpolation
Use brackets: When binding properties, the square bracket is always expected, and omitting it will lead to Angular treating it like a regular ......
Read more >
Interpolation - Pug
String Interpolation, Escaped ¶ ... Pug is smart enough to figure out where the expression ends, so you can even include } without...
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