Fetch http data before send http request in Angular 2 with RxJS
<p>I have registration form and I need to send this form with csrf token, which I should get before filled form will be send. There is not working code, but it have idea what I want.</p>

<pre><code>var model = {
            username : this.form.value.username,
            email : this.form.value.email,
            password_second : this.form.value.password_second,
            password : this.form.value.password,
            csrf : ''
        };
        this._csrfService.getToken().subscribe(
            csrf =&gt; model.csrf,
            error =&gt; console.log(error)
        );
        this._signUpService.sendForm(model)
            .subscribe(
                hero  =&gt; console.log(hero),
                error =&gt;  console.log(error));
</code></pre>

<p>SignUp and Csrf Services are obvious:</p>

<pre><code>getToken()
    {
        console.log(this.http.get(this._sighUpUrl));
        return this.http.get(this._sighUpUrl)
            .map(res =&gt;  res.json().data.csrf)
            .catch(this.handleError)
    }

sendForm(name:Object)
    {
        let body = JSON.stringify(name);
        let headers = new Headers({ 'Content-Type': 'application/json' });
        let options = new RequestOptions({ headers: headers });
        console.log(this.http.post(this._sighUpUrl, body, options));
        return this.http.post(this._sighUpUrl, body, options)
            .map(res =&gt;  res.json().data)
            .catch(this.handleError)
    }
</code></pre>

<p>How to wait while I don't get csrf token?</p>