有时post请求需要查询字符串angularjs
有时post请求需要查询字符串,即有时post请求需要查询字符串angularjs,angularjs,Angularjs,有时post请求需要查询字符串,即localhost/?password=123456不知道为什么需要添加按钮type=“button”或type=“submit”请建议谢谢 <form name="login" novalidate> <div class="row"> <input type="text" required name="email" id="username" ng-model="email" class="with-borde
localhost/?password=123456
不知道为什么需要添加按钮type=“button”
或type=“submit”
请建议谢谢
<form name="login" novalidate>
<div class="row">
<input type="text" required name="email" id="username" ng-model="email" class="with-border" autofocus=true auto-focus>
</div>
<div>
<input type="password" required name="password" id="password" ng-model="password" class="with-border" >
</div>
<a class="pull-left recover-password f-pass-valign" href="#!/forgotpassword">Forgot password?</a>
<div class="form-group">
<button ng-click="login(user.email, password)" type="button" class="btn btn-danger">Login</button>
</div>
</form>
登录
登录
使用方法作为post如果您设置按钮类型按钮,则它将仅在按钮单击上工作,而不是在
ng click上调用login(…)
,在表单上的ng submit
上调用它。任何需要替换而不是ng click to ng submit的内容??尝试设置method=“post”
在表单标签上。我不知道哪一个是opt,我应该使用ng提交到表单中还是使用post作为方法请指导@31piy@Jacob看看这个
<form name="login" novalidate method="post">
<div class="row">
<input type="text" required name="email" id="username" ng-model="email" class="with-border" autofocus=true auto-focus>
</div>
<div>
<input type="password" required name="password" id="password" ng-model="password" class="with-border" >
</div>
<a class="pull-left recover-password f-pass-valign" href="#!/forgotpassword">Forgot password?</a>
<div class="form-group">
<button ng-click="login(user.email, password)" class="btn btn-danger">Login</button>
</div>
</form>