{"size": 986, "ext": "js", "max_stars_repo_path": "app/app.js", "max_stars_repo_name": "zedany7/TownOffice-Client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/app.js", "max_issues_repo_name": "zedany7/TownOffice-Client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/app.js", "max_forks_repo_name": "zedany7/TownOffice-Client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.9787234043, "max_line_length": 92, "alphanum_fraction": 0.6876267748}
'use strict';

// Declare app level module which depends on views, and components
angular.module('myApp', [
  'ngRoute',
  'ngNotify',
  'myApp.view1',
  'myApp.view2',
  'myApp.view_form',
  'myApp.version',
  'myApp.form1',
  'myApp.form2',
  'login'
])
    .controller('navController',navController ).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
  $locationProvider.hashPrefix('!');

  $routeProvider.otherwise({redirectTo: '/login'});

}]);





function navController($scope,UserDetailsService,$rootScope){

  $rootScope.UserDetails=UserDetailsService.GetUserDetails();
  $scope.logout=function(){
    var user={};
    UserDetailsService.SetUserDetails(user);
    $scope.RefreshUser();
    window.open("#!/login", '_self', false);
  }

  $rootScope.$on("CallRefreshUserDetails", function(){
    $scope.RefreshUser();
  });
  $scope.RefreshUser=function () {
    $rootScope.UserDetails=UserDetailsService.GetUserDetails();
  }

};


