title: Populate a route with an external URL from config
body: <p>My routes are defined as:</p>
  
  <pre><code>export const routes: Routes = [
    { path: "", redirectTo: "/datasets", pathMatch: "full" },
    {
    path: "help/youtube",
    canActivate: [RedirectGuard],
    component: RedirectGuard,
    data: {
      externalUrl:  "https://youtube.com"
    }
  },
  ...
      @NgModule({
        imports: [RouterModule.forRoot(routes)],
        exports: [RouterModule]
      })
      export class AppRoutingModule {}
  </code></pre>
  
  <p>Where redirect guard is a module that handles external URLs. </p>
  
  <p>Instead of hard coding externalUrl I need to fetch it from my appConfig but I cant access appConfig without a constructor like:</p>
  
  <pre><code>constructor(@Inject(APP_CONFIG) private appConfig) {}
  </code></pre>
  
  <p>as appConfig is set up as a module with injection token like:</p>
  
  <pre><code>export const APP_CONFIG = new InjectionToken&lt;AppConfig&gt;("app.config");
  </code></pre>
  
  <p>So i tried to add this Inject to my AppRoutingModule but to no success.</p>
  
  <p>How can I access appConfig to populate this external URL?</p>