AngularJS $http.post request is canceled by Chrome

前端 未结 2 626
借酒劲吻你
借酒劲吻你 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

    instead of ng-click, so that it will submit the form when the user presses Enter

提交回复
热议问题