AngularJS $http.post request is canceled by Chrome

前端 未结 2 533
借酒劲吻你
借酒劲吻你 2021-01-21 14:20

I\'ve been googling this for hours...

here\'s my angularJS code:

var FrontControllers = angular.module(\'FrontControllers\', [] );

FrontControllers.cont         


        
相关标签:
2条回答
  • 2021-01-21 14:35

    Angular will not preventDefault() if the action parameter is set. See here

    For this reason, Angular prevents the default action (form submission to the server) unless the element has an action attribute specified.

    You should probably also use ng-submit="login() on the <form> instead of ng-click, so that it will submit the form when the user presses Enter

    0 讨论(0)
  • 2021-01-21 14:45

    Try removing form's

    action="/webapi/login"
    

    and button's

    type="submit"
    
    0 讨论(0)
提交回复
热议问题