You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.controller.js 882B

123456789101112131415161718192021222324252627
  1. angular.module('app')
  2. .controller('LoginController', ['$scope', '$state', '$mdDialog', 'luticateAuthUsers',
  3. function($scope, $state, $mdDialog, luticateAuthUsers) {
  4. $scope.user = {
  5. Username: "",
  6. Password: ""
  7. };
  8. $scope.error = null;
  9. $scope.login = function()
  10. {
  11. if ($scope.user.Username == "" || $scope.user.Password == "") {
  12. return;
  13. }
  14. luticateAuthUsers.login({
  15. username: $scope.user.Username,
  16. password: $scope.user.Password
  17. }).then(function(data)
  18. {
  19. $state.go("home");
  20. }, function (error) {
  21. $scope.error = error;
  22. });
  23. };
  24. }]);