2017-06-19 59 views
0

我的表格后如何提交表单的method = post到不同的服务器Angular2

<html> 
<head> 
    <title>Submit this form</title> 
</head> 
<body> 
    <form method="post" action="http://localhost:4200/callback"> 
     <input type="hidden" name="access_token" value="eyJ0" /> 
<input type="hidden" name="token_type" value="Bearer" /> 
<input type="hidden" name="expires_in" value="3600" /> 
<input type="hidden" name="scope" value="read write" /> 
<input type="hidden" name="state" value="Ra7JV" /> 
    </form> 
</body> 
</html> 

当有史以来http://localhost:4200/callback被称为导航到callbackComponent。但在这里它无法导航到显示无法POST /回调的callbackComponent。

我怎样才能在我的angular2回调组件中捕捉到表单。

回答

0

这是新手和我一样:

要做到这一点,我写的服务器端代码 - > Node.js的(表达),其中app.post(“/回调”)当仁不让重定向到我的客户端。

相关问题