Skip to content

Conversation

@NathanWalker
Copy link
Contributor

No description provided.

mgonto added a commit that referenced this pull request Jul 8, 2015
Update to Angular 2.0.0-alpha.30
@mgonto mgonto merged commit 8c15345 into auth0-blog:master Jul 8, 2015
@mgonto
Copy link
Contributor

mgonto commented Jul 8, 2015

Thanks :).

@PatrickJS
Copy link
Contributor

you can replace fetch with Http now that the headers work

@mgonto
Copy link
Contributor

mgonto commented Jul 8, 2015

Yep. I will. Thanks @gdi2290

@PatrickJS
Copy link
Contributor

for example

    window.fetch(url, {
      method: 'GET',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Authorization': 'bearer ' + this.jwt
      }
    })
    .then(status)
    .then(text)
    .then((response) => {
      this.response = response;
    })
    .catch((error) => {
      this.response = error.message;
    });
    http.get(url, {
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'Authorization': 'bearer ' + this.jwt
      }
    })
    .toRx()
    .map(status)
    .map(text)
    .subscribe(
      response => {
        this.response = response;
      },
      error => {
        this.response = error.message;
      }
    )

@NathanWalker
Copy link
Contributor Author

Oh thanks @ctindel, I think we do need to do that right @mgonto?

@mgonto
Copy link
Contributor

mgonto commented Jul 10, 2015

Yep we do :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants