aboutsummaryrefslogtreecommitdiffstats
path: root/app/app.route.js
blob: ee2a1613d181c33850c2a0d1b94d9dc3631cd6de (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(function () {

    'use strict';

    angular
        .module('dcaeApp')
        .config(routeConfig);

    function routeConfig($stateProvider, $urlRouterProvider, dcaeConstants) {

        //$urlRouterProvider.otherwise('/dcae/home');

        var layoutStyle = 'contentOnly';

        var layouts = {
            contentWithHeaderAndNavigation: {
                main: 'core/layouts/header-navigation-content/header-navigation-content.html',
                header: 'core/header/layouts/horizontal-navigation/header.html',
                navigation: 'core/navigation/layouts/horizontal-navigation/navigation.html'
            },
            contentOnly: {
                main: 'core/layouts/content-only/content-only.html',
                header: '',
                navigation: ''
            },
            contentWithHeader: {
                main: 'core/layouts/content-with-header/content-with-header.html',
                header: 'header/layouts/content-with-header/header.html',
                navigation: ''
            }
        };

        // @if DEBUG
        // Note: this section is removed when running grunt.
        // If you want to run the application as standalone from the dist folder you need to remove: if DEBUG and endif and build the grunt again.
        $stateProvider.state('dcae', {
            url: '/dcae',
            views: {
                'dcae@': {
                    template: '<div id="main" ui-view="main"></div>'
                }
            }
        });
        // @endif

        // State definitions
        $stateProvider
            .state('dcae.app', {
                parent: 'dcae',
                abstract: true,
                views: {
                    // This is the main view (defined in the hosting application)
                    'main@dcae': {
                        templateUrl: layouts[layoutStyle].main,
                        controller: 'MainController as vm'
                    }/*,

                    // According to the view used in "main@" we have another 3 views in main: 'header@app', 'navigation@app' and 'content@app' (defined in each page module)
                    'header@dcae.app': { // View inside the main
                        templateUrl: layouts[layoutStyle].header,
                        controller: 'HeaderController as vm'
                    },
                    'navigation@dcae.app': { // View inside the main
                        templateUrl: layouts[layoutStyle].navigation,
                        controller: 'NavigationController as vm'
                    }*/
                }
            });

    }

})();