app.controller('SignInController', ['$scope', 'Auth', '$location', 'localStorageService', '$rootScope', function ($scope, Auth, $location, localStorageService, $rootScope) { var vm = this; vm.signIn = function () { var userInfo = { email: vm.userAuthEmail }; Auth.setUser(userInfo); var userAuthenticated = function() { return localStorageService.set('userAuth', JSON.stringify(userInfo)); }(); }; }]);