【发布时间】:2019-05-28 16:32:03
【问题描述】:
我是 Angular 7 的新手,在提交表单时遇到问题。每当我提交表单时,它都会被重定向到 index.html(根据操作),而不是执行我的 typescript 方法。
这是组件的 html:
以及组件本身:
然而这是它的渲染方式:(注意 actin=index.html 属性):
当我点击登录按钮时,它会根据操作重定向:
有人有什么想法吗?
【问题讨论】:
-
编辑你的component.ts截图:一半的内容被隐藏了。
-
尝试从 HTML 中删除
method="post"。
标签: javascript html angular forms typescript