2017-06-19 40 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(「/回調」)當仁不讓重定向到我的客戶端。

相關問題