无法在Angular 2应用程序中提交HTML表单

编程入门 行业动态 更新时间:2024-10-27 20:31:23
本文介绍了无法在Angular 2应用程序中提交HTML表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图在我的Angular 2(beta2)应用程序中包含静态HTML表单,但是当我点击提交按钮时它什么也没有做。

我使用的HTML:

< form action =upload_pathmethod =POST> < input type =textname =text/> < button type =submit>发送< / button> < / form>

如何启用我的表单以使用Angular2?

< form ngNoForm ...> class =h2_lin>解决方案

您可以阻止Angular处理表单。

I'm trying to include static HTML form inside my Angular 2 (beta2) app but it doesn't do anything when I hit the submit button.

Here's the HTML I use:

<form action="upload_path" method="POST"> <input type="text" name="text" /> <button type="submit">Send</button> </form>

How can I enable my form to work with Angular2?

解决方案

With

<form ngNoForm ...>

you can prevent Angular from handling the form.

更多推荐

无法在Angular 2应用程序中提交HTML表单

本文发布于:2023-10-11 13:55:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1481891.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   应用程序   Angular   HTML

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!