main.controller.js
1.21 KB
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
36
37
38
39
40
(function() {
'use strict'
angular.module('acufuel')
.controller('MainController', [ '$scope', '$filter','$rootScope','$state', '$window', MainController]);
function MainController($scope, $filter, $rootScope,$state, $window) {
$scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName'));
$scope.testFunction = function(){
$scope.currentUserName = JSON.parse(localStorage.getItem('currentUserName'));
}
// Flight Tracking page code
/*$scope.reloadPage = function(){
console.log("if",$state)
console.log("=========state name",$state.current.name);
// $state.go('app.flightTracking', {}, {reload: 'app.flightTracking'})
//$state.go($state.current, {}, {reload: true});
if($state.current.name != "app.flightTracking"){
$window.location.href = '/#!/flightTracking';
setInterval(function(){
console.log("come")
$window.location.reload()
},10);
}else{
console.log("flight tracking state found=====");
$window.location.reload();
}
}*/
}
})();