简体   繁体   English

我的 ng-submit 不起作用我在这段代码中有什么问题?

[英]my ng-submit is not working what is my problem in this code?

in my code i didn't really understand why my ng-submit is not working..在我的代码中,我真的不明白为什么我的 ng-submit 不起作用..

<div ng-controller="cn1" class="col-lg-4" style="border:1px solid brown;border-radius:20px;">
  <h3>Input city:</h3><br>
  <form  class="text-center" ng-submit="access()">
       <div class="form-group">
           <input type="text"class="form-control" ng-model="city">
       </div><br>
       <input type="button" value="Get Details" style="text-align:center;margin-right:500;"  
                     class="btn btn-primary justify-content-center">
   </form>
   </div>

Change type from button to submit:将类型从按钮更改为提交:

<input type="button" value="Get Details" style="text-align:center;margin-right:500;"  
                     class="btn btn-primary justify-content-center">

to

<input type="submit" value="Get Details" style="text-align:center;margin-right:500;"  
                     class="btn btn-primary justify-content-center">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM