Blame view
app/views/login/login.controller.js
1.19 KB
5c6477d3d
|
1 2 3 4 |
'use strict'; //Load controller angular.module('inspinia') |
22d319238
|
5 |
.controller('LoginController', function ($scope, $state, LoginService) { |
5c6477d3d
|
6 7 8 9 |
$scope.user = {}; $scope.userData = function(){ |
0a4eb77cc
|
10 11 12 |
var loginData = "username=" + $scope.user.username + "&password=" + $scope.user.password; LoginService.loginUser(loginData).then(function(result) { console.log(result) |
7379f005b
|
13 |
$state.go('index.dashboard'); |
0a4eb77cc
|
14 |
//$state.go('index.dashboard'); |
7379f005b
|
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
// if(typeof result == 'object') { // // LoginService.authenticate(); // // LoginService.setAuth(true); // // $rootScope.path = true; // $state.go('index.dashboard'); // // var reqPwdChng = localStorage.getItem("requiredChangePwd"); // // if (reqPwdChng && reqPwdChng == "Y") { // // $state.go('resetPassword'); // // } else { // // $state.go('app.upload'); // // } // } else { // //toastr.info("Error in login. Please check login name and password"); // } |
0a4eb77cc
|
29 30 |
}) |
5c6477d3d
|
31 32 33 |
} }); |