@andy87 wrote:
My Login controller
.controller('LoginCtrl', function($scope, LoginService, $ionicPopup, $state, $cookies, $rootScope) {
$scope.data = {};$scope.create = function () { $state.go('signup'); } $scope.forgot = function () { $state.go('forgotpassword'); } $scope.login = function () { LoginService.loginUser($scope.data.user_email, $scope.data.password).success(function (data) { var wat = $rootScope.session; console.log(wat); $state.go('app.dashboard'); }).error(function (data) { var alertPopup = $ionicPopup.alert({ title: 'Login failed!', template: 'Please check your credentials!' }); }); }
})
Posts: 2
Participants: 2