2

I'd like to align/format the html code between the backticks. Is there a setting in WebStorm to achieve this?

@Component(
    {
        selector: 'my-app',
        template: `<h1>{{title}}</h1>
<h2>My Heroes</h2>
<ul class="heroes">
  <li *ngFor="let hero of heroes">
    <span class="badge">{{hero.id}}</span> {{hero.name}}
  </li>
</ul>
<h2>{{hero.name}} details!</h2>
<div>
  <label>id: </label>{{hero.id}}
</div>
<div>
  <input [(ngModel)]='hero.name' placeholder='name'/>
</div>`
    }
)

html snippet between backticks

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Jingle
  • 573
  • 3
  • 15
  • 1
    When you hover the mouse over the template html there should appear a light bulb suggesting you to edit the template. If you click on that the template opens up in seperate window to be edited. – Maximilian Riegler May 06 '16 at 10:17
  • 2
    Yes I know, but I was hoping to at least be able to align the html within the .ts file, so it's readable without having to go into "edit template mode". Formatting works with html between normal quotes but not with (es6) backtick quotes. – Jingle May 06 '16 at 16:05
  • 1
    I think this is a ticket one can track: https://youtrack.jetbrains.com/issue/WEB-18307 – Mörre Jan 13 '17 at 21:15

0 Answers0