Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. (function () {
  2.  
  3. angular
  4. .module('app.controllers')
  5. .controller('AuthController', AuthController);
  6.  
  7. AuthController.$inject = ['$state', 'UserAuthService', 'GlobalSettings'];
  8.  
  9. function AuthController ($state, UserAuthService, GlobalSettings)
  10. {
  11. var vm = this;
  12.  
  13. vm.fields = {
  14. username: '',
  15. password: ''
  16. };
  17.  
  18. vm.tryToSingIn = tryToSingIn;
  19.  
  20. function tryToSingIn () {
  21. UserAuthService.login(vm.fields)
  22. .then(function() {
  23. $state.go(GlobalSettings.HOMEPAGE)
  24. }, function () {
  25.  
  26. });
  27. }
  28.  
  29.  
  30. }
  31.  
  32. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement