Giter Club home page Giter Club logo

Comments (10)

semicolin avatar semicolin commented on May 26, 2024 1

Looks good. Thank you!

from ng-doc.

skoropadas avatar skoropadas commented on May 26, 2024

Good catch thanks! I'll fix it right now

from ng-doc.

github-actions avatar github-actions commented on May 26, 2024

🎉 This issue has been resolved in version 15.7.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

from ng-doc.

semicolin avatar semicolin commented on May 26, 2024

Thanks for the quick fix, but I think using replace() here is not a good idea because my API scope is also the same string as my baseHref, so this breaks links to API pages.

from ng-doc.

semicolin avatar semicolin commented on May 26, 2024

And even if I change the API scope name, links generated from markdown (e.g. to API pages) do not work when opening them in a new tab

from ng-doc.

skoropadas avatar skoropadas commented on May 26, 2024

Ah I see, ok let me think about a better solution maybe I will be able to prepare HTML and update href attributes on the builder side

from ng-doc.

skoropadas avatar skoropadas commented on May 26, 2024

I found a solution that I had considered during development but decided against because I thought it was unnecessary. However, now I see that it is necessary.

The problem was that although the handler used Angular Router, when hovering over a link, an incorrect address was still displayed because the actual address in the href attribute was not changing. It was only modified when attempting to navigate to the link.

I removed the code in NgDocRootComponent that handled link clicks, which sometimes intercepted clicks on links created using routerLink, leading to unexpected consequences if the URL was not properly processed, or if clicks on links in the demo were being handled when they shouldn't be.

I could have modified these links on the builder side, but that wouldn't have solved the problem of click handling in NgDocRootComponent.

Solution:
NgDoc has a mechanism for processors, which I use to convert certain HTML elements created using innerHTML into Angular components. Therefore, I added a new processor for links that wraps each link on the page in NgDocPageLinkComponent.

NgDocPageLinkComponent uses the routerLink directive, which you know modifies the link passed to it by adding baseHref, so everything should work natively through Angular Router without creating problems with baseHref.

from ng-doc.

github-actions avatar github-actions commented on May 26, 2024

🎉 This issue has been resolved in version 15.7.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

from ng-doc.

skoropadas avatar skoropadas commented on May 26, 2024

Sry, I added another fix, I forgot about links in code examples and demos that are generated based on keywords

from ng-doc.

github-actions avatar github-actions commented on May 26, 2024

🎉 This issue has been resolved in version 15.7.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

from ng-doc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.