title: Anchor fragments in Angular 6
body: <p>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:</p>
  
  <p><a href="https://stackoverflow.com/questions/50836497/using-anchor-link-id-in-angular-6">Using anchor link #id in Angular 6</a></p>
  
  <p><code>@machado</code> comment recommends following which seems like the correct approach:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>However I haven't found any documentation on how to make the links. Following dosen't work:</p>
  
  <p><strong>My link:</strong></p>
  
  <pre><code>&lt;a href="#{{group.name}}"&gt;{{group.name}}&lt;/a&gt; 
  </code></pre>
  
  <p><strong>My anchor:</strong></p>
  
  <pre><code>&lt;h2 id="{{group.name}}"&gt;{{group.name}}&lt;/h2&gt;
  </code></pre>