0

I am loading a page to a named outlet using "routerLink" like this.

<a [routerLink]="{outlets: {doc: 'introduction'}}">Introduction</a>

I need to jump to an anchor point in the loaded page. Using "routerLink", is there a way?

For example, if I have a sub-section in the page called "setup" and I want this to be navigated to on page load.

<a href="introduction">Introduction</a>

Lorem Ipsum is ...

<a href="setup">Setup</a>
devguy
  • 672
  • 3
  • 7
  • 21
  • 1
    why don't u use the good ol' method - #setup id and link as Setup ? – Varghese Mathai Dec 26 '18 at 10:56
  • It needs to work with angular routing :) using a named outlet. The link is another sidebar component. – devguy Dec 26 '18 at 11:02
  • If you are using ui.router then you will also need to do child routing, but for ngroute you can do it easy by using `#setup` for every route you want in an anchor tag. – Akhtar Munir Dec 26 '18 at 11:12
  • There is a solution in this question https://stackoverflow.com/q/44441089/5866606 Hope it helps – Jefferson Swartz Dec 26 '18 at 11:14
  • Hi JeffersonSwartz, I've seen that solution, but not exactly what I am looking for. It also doesn't work with my use case as I am rendering markdown to html in my component. – devguy Dec 28 '18 at 08:16

0 Answers0