Blame view

app/partials/dashboard/dashboard.controller.js 1.16 KB
feacde5ff   Rishav   setup acuefuel in...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  
      (function() {
      'use strict'
      
      angular.module('acufuel')
          .controller('dashboardController', [ '$scope', '$filter', '$rootScope', '$state', dashboardController]);
          
      function dashboardController($scope, $filter, $rootScope, $state) {
      	
      	$scope.logout = function () {
      		localStorage.removeItem("loginStatus");
      		$rootScope.path = false;
      		$state.reload();
      	}
  //        $scope.submitLogin = function() {
  //        	LoginService.setAuth(true);
  //        	toastr.info("Login successfully");
  //        	$state.go('app.dashboard');
  //        	/*LoginService.login($scope.username, $scope.password).then(function(result){
  //        		if(typeof result == 'object') {
  //        			LoginService.setAuth(true);
  //        			$rootScope.path = true;
  //        			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");
  //        		}
  //        	})*/
  //        }
      }
  })();