/**
 *
 */
angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvider, $urlRouterProvider, $locationProvider) {

    $locationProvider.hashPrefix('');
    $urlRouterProvider.otherwise("/employees");

    $stateProvider
        .state("layout1", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout1.html"
                }
            }
        })

        .state("layout2", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout2.html"
                }
            }
        })

        .state("layout5", {
            abstract: true,
            views: {
                "layout": {
                    templateUrl: "layout/layout5.html"
                }
            }
        })

        // .state('app', {
        //     abstract: true,
        //     views: {
        //         'main_layout': {
        //             templateUrl: 'main_layout.html',
        //         }
        //     }
        // })


        .state("employees", {
            parent: 'layout1',
            url: "/employees",
            views: {
                "content": {
                    templateUrl: "pages/employee/employee.html",
                    controller: "employeeController"
                }
            }
        })
        .state("project", {
            parent: 'layout1',
            url: "/project",
            views: {
                "content": {
                    templateUrl: "pages/project/project.html",
                    controller: "projectController"
                }
            }
        })
        .state("report", {
            parent: 'layout1',
            url: "/report",
            views: {
                "content": {
                    templateUrl: "pages/employee/project.html",
                    controller: "employeeController"
                }
            }
        })
        .state("timeSheet", {
            parent: 'layout5',
            url: "/timesheet",
            views: {
                "content": {
                    templateUrl: "/pages/timesheet/timeSheet.html",
                    controller: "timeSheetController"
                }
            }
        })
        .state("timeSheetDetail", {
            parent: 'layout5',
            url: "/timesheetdetail/:id",
            views: {
                "content": {
                    templateUrl: "/pages/timesheet/timeSheetDetail.html",
                    controller: "timeSheetDetailController"
                }
            }
        })
        .state("leaveForm", {
            parent: 'layout5',
            url: "/leaveform",
            views: {
                "content": {
                    templateUrl: "/pages/leaveform/leaveForm.html",
                    controller: "leaveFormController"
                }
            }
        })

        .state("leaveFormDetail", {
            parent: 'layout5',
            url: "/leaveformdetail/:id",
            views: {
                "content": {
                    templateUrl: "/pages/leaveform/leaveFormDetail.html",
                    controller: "leaveFormDetailController"
                }
            }
        })

        // .state("testlayout2", {
        //     parent: 'layout2',
        //     url: "/testttt",
        //     views: {
        //         "content": {
        //             templateUrl: "/pages/testlayout/testlayout.html",
        //             controller: "testlayoutController"
        //         }
        //     }
        // })
        .state("gioithieu", {
            parent: 'app',
            url: "/gioithieu",
            views:{
                "content":{
                    templateUrl: "pages/gioithieu/gioithieu.htm",
                    controller: "gioithieuController"
                }
            }
        })

});

    // .state("lienhe", {
    // 	parent: 'app',
    //     url: "/lienhe",
    //     views:{
    //     	"content":{
    //     		 templateUrl: "pages/lienhe/lienhe.htm",
    //     	     controller: "lienheController"
    //     	}
    //     }
    // })
    

// myApp.directive('ngConfirmClick', [ function() {
//     return {
//         link : function(scope, element, attr) {
//             var msg = attr.ngConfirmClick || "Are you sure?";
//             var clickAction = attr.confirmedClick;
//             element.bind('click', function(event) {
//                 if (window.confirm(msg)) {
//                     scope.$eval(clickAction)
//                 }
//             });
//         }
//     };
// } ])
