rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.9k stars 280 forks source link

File list links are not working in Angular integration for diff2html-ui #510

Closed sogistuvsogistuv closed 5 months ago

sogistuvsogistuv commented 1 year ago

We are really grateful for the work you put into this project and so far it worked like charm.

However, I have a question, or rather a request for assistance, pertaining to the links within the file list. I'm currently utilizing the latest diff2html-ui in with with Angular 13, configured essentially as follows: const configuration = { drawFileList: true, matching: 'none', highlight: true, outputFormat: 'line-by-line', renderNothingWhenEmpty: true };

Each entry in the file list is clickable and supposed to lead to the corresponding anchor. As I understand the linkId is generated by using a simple hash function (link to code). The issue in my Angular application is that these link just reload the page, as there is no router for these "dynamic" ids. How can I make these links functional within the Angular framework?

A temporary solution would be to deactivate the links, but from my understanding, this requires overwriting the template. Is there an alternative approach?

I also created a stackoverflow question regarding this matter ,but I have reservations about receiving a response there, which is why I've raised this issue here.

Could you please provide guidance on resolving this Angular integration challenge with the diff2html-ui file list links?

rtfpessoa commented 1 year ago

👋 Unfortunately I don't have a lot of frontend experience and specially with angular and I mostly used react. Usually the id should be handled by the browser not even angular, but I guess angular is hijacking the process.

Maybe this can work https://stackoverflow.com/a/48278151?

rtfpessoa commented 5 months ago

Closing due to inactivity