app.controller('layOutCtrl', ['$scope','$rootScope', '$http', '$state', '$filter','$localStorage','HttpService', function($scope,$rootScope, $http,$state, $filter,$localStorage,HttpService) {


    if($rootScope.loginData.login == false){
        $state.go("signin")
    }else{
        $scope.logout = function(){
            HttpService.logout(function(data) {})
            $state.go("signin")
            localStorage.removeItem("ngStorage-loginData");
            location.reload();
        }

        $scope.icons = [
            "glyphicon glyphicon-list icon text-primary",
            "fa fa-file icon text-info",
            "glyphicon glyphicon-briefcase icon text-danger",
            "glyphicon glyphicon-th-large icon text-success",
            "glyphicon glyphicon-stats icon text-primary-dker"
        ]

        $scope.menuList = $rootScope.loginData.roleList[0].permissions;
    }

}])