app.controller('SignInController', ['$scope', 'loginStatus', '$location', function ($scope, loginStatus, $location) { var vm = this; vm.userProfile = {}; // vm.message = loginStatus; vm.sign_in = function() { vm.userProfile.email = vm.userAuthEmail; vm.userProfile.password = vm.userAuthPassword; if (vm.userProfile.email === loginStatus.email && vm.userProfile.password === loginStatus.password) { console.log('yes!'); $location.path('/home'); } else { alert("wrong") } }; }]);