Is it possible, maybe with an extension, to use Go To Definition (F12) when editing an html file of an Angular project?
Let's assume, in sample.html:
<input matInput class="app-input" placeholder="InputName" [(ngModel)]="myNodel.name"> ... <button mat-mini-fab class="plus" (click)="myMethod()" <mat-icon>arrow_forward</mat-icon> </button>
I would like to navigate to "myMethod() ..." in sample.ts, or navigate to the field of the model, to the line "name: string;" in my-model.ts, as the function normally works with .ts files.
Go to Definition# Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.
In Visual Studio, the Go To Definition and Peek Definition features enable you to easily view the definition of a type or member. If the source code is not available, metadata is displayed instead.
Go to the Extensions view (Ctrl+Shift+X) and type 'html' to see a list of relevant extensions to help with creating and editing HTML.
You can do this with the extension
Angular Language Service extension for VS Code.
which has the feature
This extension provides a rich editing experience for Angular templates, both inline and external templates including:
Completions lists
AOT Diagnostic messages
Quick info
Go to definition
Angular Language Service - A handy extension for angular developers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With