Create A Fragment URL in Angular 8 (Jump-To-Anchor)

6 responses to “Create A Fragment URL in Angular 8 (Jump-To-Anchor)”

  1. tryinghard says:

    How can i change this so each paragraph is different rather than the same thing repeated over and over?

    • Rehmaanali says:

      It can be based on your data for the demo I have just repeated the same content.
      your data can be like

       {id: 'asdasd-asd-asdas, post: '<p>some content...</p>'}
       {id: 'cxxfsd-scs-rrded, post: '<p>some content...</p>'}

      so Inside [innerHTML] you can pass post object

  2. Anonymous says:

    It was not helpful to me as focus is not set on target so not acting like a normal internal anchor

  3. CJRamki says:

    scrollPositionRestoration is breaking anchorScrolling functionality. Is there anyway to fix?

    • Rehmaanali says:

      hi CJRamki,
      You must be referring to the single page application demo due to that it was not able to route
      I have made changes in the demo you can refer the code from below link
      Demo and Code

      Changes :
      scrollPositionRestoration will work if the <router-outlet></router-outlet> is in the application.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.