In TypeScript, what is the right way to reference the current file and directory, like __filename
and __dirname
in Node.js, that would work when compiling for the client-side?
I'm currently working on an Angular.js 4 project, implementing components that provide their own sub-routing, which is too verbose and error-prone for the clients to reference directly, so I want those components to be able to generate proper routing override by themselves, which in turn requires that each such component knows its file name and the relative directory where it sits.