framework icon indicating copy to clipboard operation
framework copied to clipboard

question: How can I redirect after a get (login) request ?

Open ClarisseL opened this issue 11 years ago • 2 comments

I'm getting the token like this:

getToken(){
return this.http.get(this.url).then(response => {
  var result = JSON.parse(response.response)
  console.log(response);
  // I persist the token
  // Here I'd like to navigate to another page
}).catch(err =>{
  console.log(err);
  alert(JSON.parse(err.response).error);
});

}

I read the doc on aurelia.io from beginning to end and the only interesting this about this was Redirect but I don't really understand how to use it ?

ClarisseL avatar Apr 17 '15 08:04 ClarisseL

Ok so I found a few example apps and used:

this.router.navigate('another_route');

ClarisseL avatar Apr 17 '15 10:04 ClarisseL

Hello Clarisse, great that you found your answer. I'd welcome you to join our gitter channel where those kind of questions get solved pretty quickly

zewa666 avatar Apr 17 '15 11:04 zewa666