<https://lh3.googleusercontent.com/-wJpcyEf_cMA/VX_mAUfvI0I/AAAAAAAADYk/8F0aKgAB-N4/s1600/Selection_001.png>
I have created a login form in angular jS with the below mentioned code.
<form id=loginform class=form-horizontal role=form name=myform ng-submit=
*login1*() novalidate method="post">
<div style="margin-bottom: 25px" class=input-group>
<span class=input-group-addon><i class="glyphicon
glyphicon-user"></i></span> <input name=username type=text
class=form-control id=id_username ng-model=user.username ng-required=true>
<p class="error validationerror"
ng-show="myform.username.$invalid && myform.username.$touched"></p>
</div>
<div style="margin-bottom: 25px" class=input-group>
<span class=input-group-addon><i class="glyphicon
glyphicon-lock"></i></span> <input id=login-password type=password
class=form-control name=password ng-model=user.password ng-required=true>
<p class="error validationerror"
ng-show="myform.password.$invalid && myform.password.$touched"></p>
</div>
<span id="message"></span>
<https://lh3.googleusercontent.com/-wJpcyEf_cMA/VX_mAUfvI0I/AAAAAAAADYk/8F0aKgAB-N4/s1600/Selection_001.png>
<div class=input-group>
<div class=checkbox><label><input id=login-remember
type=checkbox name=remember value=1> Remember me</label></div>
</div>
<div style=margin-top:10px class=form-group>
<div class="col-sm-12 controls"><button type=submit
href=#/login class="btn btn-primary"
ng-disabled=myform.$invalid>Login</button></div>
</div>
</form>
Now I implement the login1 function on my custom dashboard.min.js file as
shown below.
angular.module("RDash").config(["$stateProvider", "$urlRouterProvider",
function(e, t) {
t.otherwise("/logg"), e.state("verify", {
url: "/verify",
templateUrl: "php/verifyAuthentication.php"
})
}]);
function LoginController(s, l, h) {
s.*login1* = function() {
console.log(s.user.username);
var data = $.param({
json: JSON.stringify({
name: s.user.username,
pass: s.user.password
})
});
h.post(l.path("/verify"), data).success(function(data, status) {
console.log(data);
})
}
}
angular.module("RDash").controller("LoginController", ["$scope",
"$location", "$http", LoginController]);
I have deployed the entire code in apache tomcat and i am facing a POST
error on clicking submit. The error is :
Note : The submit button posts the request to a verifyAuthentication.php
page..(Check above)
POST http://localhost:8080/tailf/[object%20Object] 404 (Not Found)
Can somebody let me know as to why am I facing this issue.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.