title: how can I get the fragment of the URL on first load in angular 6
body: <p>I'm trying to get the fragment when the page first load but I'm getting undefined instead.</p>
  
  <p>right now I'm subscribing to the  route service fragment and calling it on init.</p>
  
  <pre><code>export class MyComponent implements OnInit {
      public fragment;
      constructor(
          public route: ActivatedRoute   
      ) { }
  
      ngOnInit() {
          this.route.fragment.subscribe(fragment =&gt; {
              console.log(fragment) // undefined expecting the fragment route on load
          })
      }
  }
  </code></pre>