Advertisement
Guest User

Untitled

a guest
Mar 17th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. $stateProvider.state('/login',{
  2. url:'/login',
  3. templateUrl:'login.html',
  4. controller:'apcontroller'
  5. })
  6. .state('/Registration',{
  7. url:'/Registration',
  8. templateUrl:'Registration.html',
  9. controller:'apcontroller1'
  10.  
  11. .state('/Forgotpassword',{
  12. url:'/Forgotpassword',
  13. templateUrl:'Forgotpassword.html',
  14. controller:'Forgotpasswordcontroller'
  15.  
  16. .state('/Sendmail',{
  17. url:'/Sendmail',
  18. templateUrl:'Sendmail.html',
  19. controller:'Sendmailcontroller'
  20.  
  21. .state('/Changepassword',{
  22. url:'/Changepassword',
  23. templateUrl:'Changepassword.html',
  24. controller:'Changepasswordcontroller'
  25.  
  26. .state('/welcome',{
  27. url:'/welcome',
  28. templateUrl:'welcome.html',
  29. controller:'welcomecontroller'
  30.  
  31. }]);
  32.  
  33. var getUsername = $scope.usepas.username;
  34. var getPassword = $scope.usepas.password;
  35.  
  36. var username = resultss[i].Username;
  37.  
  38. var value;
  39. if(username == getUsername)
  40. {
  41. $sessionStorage.sessname = username; // set sessionstorage
  42.  
  43. var password = resultss[i].Password;
  44.  
  45. if(password == getPassword)
  46. {
  47. session = username;
  48.  
  49. value = getPassword;
  50. }
  51.  
  52. }
  53.  
  54. }
  55. if(value)
  56.  
  57. {
  58.  
  59. $location.path( "/welcome" );
  60.  
  61. }
  62. else
  63. {
  64. $scope.error ="Invalid username and password";
  65. }
  66. });
  67.  
  68. $scope.logout = function(){
  69. delete $sessionStorage.sessname;
  70. $location.path('/login');
  71. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement