I have a login form that uses ng-model
to pass the data to the controller. When the ng-submit
is called, I pass this data to the server to authenticate the user.
However, in Firefox only, and only on our live (https) server, the model values are never updated. Using console.log($scope.loginform)
simply prints the default values:
{ username="", password=""}
In development (http), and when using Chrome, it properly updates them with the entered values:
{ username="kermit", password="noteasybeinggreen"}
Here's my form, in jade
format
form(method='post',ng-submit='login()')
ol
li
label(class='icon-user')
input(type='text',name='username',ng-model='loginform.username',placeholder='Username')
li
label(class='icon-key')
input(type='password',name='password',ng-model='loginform.password',placeholder='Password',class='pass')
li
input(type='submit',class='pressable',value='Login')
And my controller:
.controller('LoginController', ['$scope','$http','$stateParams',function($scope,$http,$stateParams) {
$scope.loginform = {
username: '',
password: ''
};
$scope.login = function() {
console.log( 'login called: ', $scope.loginform );
$http.post('/login', $scope.loginform).success(function(resp, status, headers, config) {
// stuff
})
.error(function(resp, status, headers, config){
// stuff
});
};
}]);
Is there something I'm missing, doing wrong, etc? I can't understand why it's only Firefox.
This page is currently live at https://pste.me/#/login