Blame view

app/views/login/login.controller.js 1.19 KB
5c6477d3d   Rishav   Admin Acufuel set...
1
2
3
4
  'use strict';
  
   //Load controller
    angular.module('inspinia')
22d319238   Rishav   login next page
5
  	.controller('LoginController', function ($scope, $state, LoginService) {
5c6477d3d   Rishav   Admin Acufuel set...
6
7
8
9
        
        $scope.user = {};
        $scope.userData = function(){
            
0a4eb77cc   Rishav   FBO admin impleme...
10
11
12
            var loginData = "username=" + $scope.user.username + "&password=" + $scope.user.password;
            LoginService.loginUser(loginData).then(function(result) {
              console.log(result)
7379f005b   Rishav   FBO client page d...
13
              $state.go('index.dashboard');
0a4eb77cc   Rishav   FBO admin impleme...
14
              //$state.go('index.dashboard');
7379f005b   Rishav   FBO client page d...
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   Rishav   FBO admin impleme...
29
30
            })
            
5c6477d3d   Rishav   Admin Acufuel set...
31
32
33
        }
        
    });