Advertisement
Guest User

Untitled

a guest
Apr 11th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. .controller("loginController", function($scope, $location, $rootScope){
  2. $scope.login = function() {
  3. var user = $scope.username;
  4. var password = $scope.password;
  5. var result = $scope.username + $scope.password;
  6. console.log(result);
  7. if (user == "admin" && password == 'admin'){
  8. $rootScope.loggedIn = true;
  9. $location.path('/welcome');
  10. } else {
  11. alert("INVALID CREDENTIALS");
  12. }
  13. }
  14. .controller('welcomeController', function($scope){
  15. $scope.message = "welcome here"
  16. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement