Hello,
i have an external url for login.in my view have a form i have an username and a password.i use ng-model so i can pass them in the post request.
my problem is that the request doesn’t appear in dev tools.i tried with Fiddler and i got nothing from it too.nothing
here’s the code of the view
<label for="field1"><span>nom d'utilisateur:</span> <div class="loginform"><input type="text" class="input-field" name="field1" value="" ng-model="username" /></div></label>
<label for="field2"><span>mot de passe:</span><div class="loginform"><input type="password" class="input-field" name="field2" value="" ng-model="password" /></div></label>
<div class="boutonlogin">
<button class="button button-full button-energized button-small" ng-click="submit()">Connexion</button>
</div>
<label>
<b><center>si vous n'avez pas de compte,veuillez vous s'enregistrer</center></b>
</label>
<div class="boutonlogin">
<button class="button button-full button-energized button-small" ng-click="modal.hide()" ng-href="#/signup/{{flag}}">s'enregistrer</button>
</div>
the code of the controller
//login controller----------------------------------------
.controller('loginCtrl',function($scope,$stateParams,$http)
{
$scope.flag=$stateParams.flag;
$scope.submit=function()
{
var loginServiceUrl = 'https://www.yabiladi.com/newsapi/login.json';
var loginServiceData = {
email: username,
senha: password
};
$http.post(loginServiceUrl, loginServiceData).
then(function (res){
console.log(res);
}).catch(function(response){
console.log("nothing");
});
}
})
the request isn’t fired at all.and i don’t know why really.
thank you