I have a weird issue with the {{json_req}} expression, the {{pseudo}} and {{password}} expression are working well, I can see the changes I make in live.
But nothing happened for the {{json_req}} expression, no matter what I write on the Login and Password input.
I guess It's a basic mistake by me but I'm a little lost with this one right now :/.
Thanks for the help :)
Login.html
<div class="row">
Pseudo : {{pseudo}}
</div>
<div class="row">
Password : {{password}}
</div>
<div class="row">
json : {{json_req}}
</div>
<div class="row">
<label class="float-center">
Pseudo
<input ng-model="pseudo" type="text" required>
<span class="form-error">
Pseudo Missing.
</span>
</label>
</div>
<div class="row">
<label class="float-center">
Password
<input ng-model="password" type="password" required>
<span class="form-error">
Password Missing.
</span>
</label>
</div>
LoginCtrl.js
mCtrl.controller('LoginCtrl', ['$scope', 'User', function ($scope, User) {
$scope.json_req = {
pseudo: $scope.pseudo,
password: $scope.password
};
$scope.LoginUser = function () {
if ($scope.json_req.pseudo != undefined && $scope.json_req.password != undefined) {
User.login($scope.json_req).then(function (data) {
$scope.response = data;
$scope.json_req = {};
});
} else
console.log("UNDEFINED");
};
}]);
$scope.json_reqis an object, so you'll have to specify which property you want to show. What output are you getting?