(function() {
  'use strict';

  angular
    .module('static')
    .controller('LoginController', LoginController);

  /** @ngInject */
  function LoginController($rootScope, AUTH_EVENTS, AuthService) {
    var vm = this;

    vm.isAuthenticated = AuthService.isAuthenticated;

    vm.credentials = {
      username: '',
      password: ''
    };

    vm.submit = function submitLogin(credentials) {

      AuthService.login(credentials).then(function (user) {
        $rootScope.$emit(AUTH_EVENTS.loginSuccess, user);
      }, function () {
        $rootScope.$emit(AUTH_EVENTS.loginFailed);
      });
    };
  }
})();

@@ -160,33 +160,8 @@
 ler(
-$rootScope, AUTH_EVENTS, 
 Auth
@@ -202,53 +202,28 @@
  vm.
-isAuthenticated = AuthService.isAuthenticated
+submit = submitLogin
 ;%0A%0A 
@@ -294,28 +294,16 @@
  %7D;%0A%0A   
- vm.submit =
  functio
@@ -331,17 +331,16 @@
 ials) %7B%0A
-%0A
       Au
@@ -371,180 +371,16 @@
 als)
-.then(function (user) %7B%0A        $rootScope.$emit(AUTH_EVENTS.loginSuccess, user)
 ;%0A    
- 
- %7D, function () %7B%0A        $rootScope.$emit(AUTH_EVENTS.loginFailed);%0A      %7D);%0A    %7D;
+%7D%0A
 %0A  %7D

Clean up Login controller