Angular2 Routing with Hashtag to page anchor

Discussão em 'Angular' iniciado por Stone, Novembro 26, 2025.

  1. Stone

    Stone Guest

    I wish to add some links on my Angular2 page, that when click, will jump to specific positions within that page, like what normal hashtags do. So the links would be something like

    /users/123#userInfo
    /users/123#userPhoto
    /users/123#userLikes


    etc.

    I don't think I need HashLocationStrategy, as I'm fine with the normal Angular2 way, but if I add directly, the link would actually jump to the root, not somewhere on the same page. Any direction is appreciated, thanks.

    Continue reading...

Compartilhe esta Página