title: How to resolve data from an api using angular route resolver
body: <p>I am trying to use angular route resolver to load an endpoint before it displays but I can not find a way to go about it
  How do I pass the url of my API in my resolver as a parameter?
  For some unique reason I need to pass in an parameter so I can not pass the api in the service.</p>
  
  <p>This is my service</p>
  
  <pre><code>@Injectable()
  export class HnService {  
    constructor(private http: HttpClient) {}
  
    getTopPosts(endpoint) {
      return this.http.get(endpoint);
    }
  }
  </code></pre>
  
  <p>This is my resolver file</p>
  
  <pre><code>@Injectable()
  export class HnResolver implements Resolve&lt;any&gt; {
    constructor(private hnService: HnService) {}
  
    resolve() {
      return this.hnService.getTopPosts(?);
    }
  }
  </code></pre>