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 921B

12345678910111213141516171819202122232425262728
  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. $scope.error = null;
  12. if ($scope.user.Username == "" || $scope.user.Password == "") {
  13. return;
  14. }
  15. luticateAuthUsers.login({
  16. username: $scope.user.Username,
  17. password: $scope.user.Password
  18. }).then(function(data)
  19. {
  20. $state.go("images");
  21. }, function (error) {
  22. $scope.error = error;
  23. });
  24. };
  25. }]);