Having just started with AngularJS, I find myself in a bit of a pickle. When trying to submit a form, I encounter the following error message: POST 400 (Bad Request). This issue occurs specifically during the form submission process. If anyone could provide some guidance, it would be greatly appreciated. Below is a snippet from my service:
(function () {
'use strict';
angular
.module('vidaexpress')
.service('accountService', accountService);
accountService.$inject = ['$http', '$window', '$rootScope', 'apiUrl'];
function accountService($http, $window, $rootScope, apiUrl) {
// Service code here...
}
})();
Check out my controller as well:
(function () {
'use strict';
angular
.module('vidaexpress')
.controller('accountController', accountController);
accountController.$inject = ['$rootScope', '$state', '$stateParams', 'accountService', 'facebookService', 'toastr'];
function accountController($rootScope, $state, $stateParams, accountService, facebookService, toastr) {
// Controller code here...
}
})();
Finally, let's take a look at my view:
<form class="form" name="loginform" ng-submit="loginform.$valid && vm.logIn(vm.login)" novalidate>
<div class="form-group">
<label for="email">{{'USERNAME' | translate}} ({{'EMAIL' | translate}})</label>
<input id="email" name="email" class="form-control" required ng-model="vm.login.email" ng-focus="vm.loginerror = '';" ng-pattern="/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z0-9]{2,6}$/">
<div class="error_msg" ng-show="loginform.email.$error.required && vm.submit">{{ 'EMAIL_ENTER' | translate }}</div>
<div class="error_msg" ng-show="loginform.email.$error.pattern && vm.submit">{{ 'EMAIL_ERROR_PATTERN' | translate }}</div>
</div>
// View code continues...