I am trying to do something as simple as making anchor links that jump to a link on the same page. There is surprisingly only very limited documentation but I found following:
Using anchor link #id in Angular 6
@machado
comment recommends following which seems like the correct approach:
const routerOptions: ExtraOptions = {
useHash: false,
anchorScrolling: 'enabled',
// ...any other options you'd like to use
};
// Then just import your RouterModule with these options
RouterModule.forRoot(MY_APP_ROUTES, routerOptions)
However I haven't found any documentation on how to make the links. Following dosen't work:
My link:
<a href="#{{group.name}}">{{group.name}}</a>
My anchor:
<h2 id="{{group.name}}">{{group.name}}</h2>