angular - 发布到 Angular 4/5 页面

标签 angular post angular5 form-submit form-data

我面临的情况是,我必须向客户提供我的网络应用程序的链接,他们将把表单发布到我的网页上。该应用程序是在 Angular 5 上创建的。我一直在谷歌上搜索;但没有找到解决方案。我希望你们中的任何人都可以帮助我。

<form action="http://localhost:4200/#/activateaccount" >
    <input type='Hidden' name='loginId' value='<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd9c958e9c93d3948c9f9c91bd9c9f9ed39e92d38896" rel="noreferrer noopener nofollow">[email protected]</a>'/>
    <input type="submit" value="Submit">
</form>

提交代码将是这样的。在实际操作中,该链接是我的 Angular 5 应用程序的链接。可以发布到 Anuglar 5 页面吗?

不过,提前致谢。

最佳答案

Post 请求发送到服务器,Angular 不会看到它,因为它在客户端运行。您可以发布到应用程序的index.html,但我怀疑这就是您想要的。

您想要的是可以接受 http post 的 REST API 端点。

查看

How to receive POST request in an AngularJS page?

External servers posting to angular 2 routes

关于angular - 发布到 Angular 4/5 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50455352/

相关文章:

angular - 使用全局错误处理程序处理 NGXS (angular) 中的错误

rest - HTTP 动词 - 何时使用 GET/POST/PUT/Delete

Magento 支付模块,如 PayPal(外部 URL 重定向)

php - 使用 PHP 将 Post 数据写入文件

在浏览器中加载应用程序时 Firebase JS SDK 发出警告(角度 v5)

javascript - Angular 中如何从 json 中获取数据分页

angular - 在 Angular 应用程序之间共享代码

cordova - resolveLocalFileSystemURL 不是一个函数 - Angular2

css - 如何使用 Angular 5 基于其组件将特定类添加到导航栏

Angular 5 - react 形式