1

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?

jfrantzius
  • 623
  • 7
  • 16

1 Answers1

0

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

Somnath Sinha
  • 662
  • 6
  • 16
  • I want to see its behaviour, learn from it, workaround something, or override some behaviour. That's what OpenSource is for, after all ;-) Also I'd like to be able to navigate from there to other classes it makes use of, to do the same. – jfrantzius Dec 06 '17 at 11:48
  • Okay :), You can follow the Angular Github page then to see the .ts version of the code. – Somnath Sinha Dec 06 '17 at 12:58
  • In Java development it became standard for dependencies to provide a source attachment, which the IDE uses to let the developer seamlessly navigate from own sourcecode to dependencies' sourcecode. So I guess TypeScript tooling just hasn't yet evolved yet as far as that. I cloned the Angular Git repo and added it to VisualStudio, but it seems I cannot just open the Symbol (class) I'm looking for, but have to manually find the correct file and open it? – jfrantzius Dec 11 '17 at 16:01