Navigating to Angular Sourcecode in VisualStudio?

29 views Asked by At

In my Angular app sourcecode (built using node), I use some type from Angular itself e.g. like this:

import {HashLocationStrategy} from '@angular/common';

When I now try to navigate to the HashLocationStrategy Angular type in VisualStudio, e.g. by choosing "Go to definition" from the context menu, I end up in the file node_modules/@angular/common/src/location/hash_location_strategy.d.ts. That file is only a Declaration File, containing only the type signatures and not the actual implementation itself.

How can I navigate to the actual sourcecode of HashLocationStrategy?

1

There are 1 answers

3
Somnath Sinha On

Why do you want to navigate to the Source File?

Though, parallel to the .d.ts file you will have a .js file which consist of the JavaScript version of the Source Code.

If you want to explore .ts version, you can explore it here, https://github.com/angular/angular/blob/5.0.5/packages/common/src/location/hash_location_strategy.ts#L15-L88