4
我正在使用angularScript 2打字稿,並在編寫內聯模板時使用反引號。Typescript反斜槓語法突出顯示
但內部的內容沒有突出顯示,它保持相同的顏色,有時難以調試。
@Component({
selector: "my-template-driven",
template: `
<h2>Sign-up Form</h2>
<form (ngSubmit)="onSubmit(f)" #f="ngForm">
<section>
<label for="email">Email</label>
<input type="email" id="email" ngControl="email" #email="ngForm">
<span class="validation-error" required *ngIf="!email.valid">Not Valid</span>
</section>
<section>
<label for="password">Password</label>
<input type="password" id="password" ngControl="password" #password="ngForm">
<span class="validation-error" required *ngIf="!password.valid">Not Valid</span>
</section>
<section>
<label for="confirm-password">Confirm Password</label>
<input type="confirm-password" id="confirm-password" ngControl="confirm-password" #confirmPassword = "ngForm">
<span class="validation-error" required *ngIf="!confirmPassword.valid">Not Valid</span>
</section>
<button type="submit">Submit</button>
</form>
`
})
有沒有解決方法呢?還有什麼IDE支持這個?
我不知道原子的插件。但'webstorm'確實有這個功能。您甚至可以從模板內跳轉到組件,方法和屬性 – PierreDuc
我正在使用WebStorm 11.0.3,它具有您正在查找的功能。 –
https://www.jetbrains.com/help/phpstorm/2016.1/using-language-injections.html和https://blog.jetbrains.com/webstorm/tag/angular2/ –