Advertisement
Guest User

Untitled

a guest
Sep 12th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var self = this;
  2. self.user={uname:'',password:''};
  3. self.users=[];
  4. this.postForm=function(user)
  5. {
  6. var deferred = $q.defer();
  7. $http.post('http://localhost:8080/HB2/login/', user)
  8. .then(
  9. function (response) {
  10. deferred.resolve(response.data);
  11. console.log("Success");
  12. },
  13. function(errResponse){
  14. console.error('Invalid Username/Password');
  15. deferred.reject(errResponse);
  16. }
  17. );
  18. return deferred.promise;
  19. };
  20.  
  21. if ((user.getUname().equals("kartik"))&&(user.getPassword().equals("gogia"))) {
  22.  
  23. return new ResponseEntity<Void>(HttpStatus.OK);
  24. }
  25. else
  26. return new ResponseEntity<Void>(HttpStatus.NO_CONTENT);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement