angular2 route resolve gaurd - how to pass variables to the service
<p>I am using angular rc2 and have a question about route resolve guard.</p>

<p>This is my resolve service.  It works fine.</p>

<pre><code>import { Injectable } from '@angular/core';
import { Router, Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs/Observable';
import { ApiService } from '../api_service/api.service';
import 'rxjs/add/operator/take';
import { BasicSetup } from './basic_setup'
@Injectable()
export class BasicSetupResolve implements Resolve&lt;any&gt; {

  constructor(private _apiService: ApiService, private router: Router) {}



    resolve(route: ActivatedRouteSnapshot): Observable&lt;any&gt; | Promise&lt;any&gt; | any {
        let id = route.params['id'];
        let model_id = id;
        let endpoint='/test/model/basic';
        return new Promise((resolve) =&gt; { this._apiService.getModel(endpoint,model_id,false).subscribe(api_object =&gt; {
                if (api_object) {
                    return resolve(api_object); 
                } else { // id not found
                    this.router.navigateByUrl('/dashboard(content:models/basic/' +  model_id +')');
                    return false;
                }
                });

        });
      }
    }
</code></pre>

<p>Here is my app.route.ts</p>

<pre><code>{ path: 'models/basic/:id', component: mesaBasicComponent,canActivate: [AuthGuard], resolve: {results: BasicSetupResolve},outlet:'content' },
</code></pre>

<p>I need to pass a variable to make more dynamic because by endpoint changes else I would have to make a separate service for each endpoint:</p>

<pre><code>  let endpoint='/test/model/basic'; 
</code></pre>

<p>How would I pass that to the service?</p>