angular icon indicating copy to clipboard operation
angular copied to clipboard

[Feature request] Optional whitespace between inline elements

Open HarryMtv opened this issue 6 years ago • 0 comments

  • [ ] Dart SDK Version (2.4.0)
  • [ ] AngularDart Version (5.3.1)
  • [ ] Any OS
  • [ ] Any browser

Problem: I have code in angular template:

<span>
   Hello
</span>

<span>
   World
</span>

After minification it's looks like:

<span>Hello</span> <span>World</span>

I know whitespace between inline elements it is default behavior for HTML, but in template it's look so bad, than i want to have (for example) greater or lower space between elements, i need to write:

<span>{{user.firstName}}</span><span class="class-with-left-margin">{{user.lastName}}</span>

or add css hacks.


Solution: Implement something like this https://reacttraining.com/blog/jsx-the-confusing-parts/#whitespace in react, it can be option for component like preventWhitespace.

I can do this if you approve it.

Context information: https://github.com/dart-lang/angular/blob/master/angular_ast/lib/src/visitors/whitespace.dart#L124

HarryMtv avatar Nov 26 '19 15:11 HarryMtv