Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Using nested views content is never loaded #5

Open
mtpultz opened this issue Oct 4, 2016 · 2 comments
Open

Using nested views content is never loaded #5

mtpultz opened this issue Oct 4, 2016 · 2 comments

Comments

@mtpultz
Copy link

mtpultz commented Oct 4, 2016

Using the views example content isn't loaded. The menu template is displayed, but no content appears where the view should be displayed. I just found this decorator, and it seemed to work after porting the routes to look like the example, but not within nested views. Was super happy to find this since Ionic won't be updating the router in v1.3.1 holding it at v0.2.x.

(function () {

    'use strict';

    function routes($stateProvider) {

        $stateProvider

            .state('menu', {
                name: 'menu',
                component: 'menuPage', // menu and surround template are loaded
                url: '/main',
                abstract: true
            });
    }

    routes.$inject = [
        '$stateProvider'
    ];

    angular
        .module('app')
        .config(routes);

})();

(function () {

    'use strict';

    function routes($stateProvider) {

        $stateProvider
            .state('menu.auth', {
                name: 'auth',
                url: '/auth',
                views: {
                    'content@': {
                        component: 'authPage' // authentication page is not loaded within the content area
                    }
                }
            });
    }

    routes.$inject = [
        '$stateProvider'
    ];

    angular
        .module('app')
        .config(routes);

})();
@mtpultz mtpultz changed the title Using views example content is never loaded Using nested views content is never loaded Oct 4, 2016
@mtpultz
Copy link
Author

mtpultz commented Oct 4, 2016

Seems to work if I just do this instead:

(function () {

    'use strict';

    function routes($stateProvider) {

        $stateProvider
            .state('menu.auth', {
                name: 'auth',
                url: '/auth',
                component: 'authPage' // authentication page is now loaded
            });
    }

    routes.$inject = [
        '$stateProvider'
    ];

    angular
        .module('app')
        .config(routes);

})();

@GONNAGITU72
Copy link

(function () {

'use strict';

function routes($stateProvider) {

    $stateProvider

        .state('menu', {
            name: 'menu',
            component: 'menuPage', // menu and surround template are loaded
            url: '/main',
            abstract: true
        });
}

routes.$inject = [
    '$stateProvider'
];

angular
    .module('app')
    .config(routes);

})();

(function () {

'use strict';

function routes($stateProvider) {

    $stateProvider
        .state('menu.auth', {
            name: 'auth',
            url: '/auth',
            views: {
                'content@': {
                    component: 'authPage' // authentication page is not loaded within the content area
                }
            }
        });
}

routes.$inject = [
    '$stateProvider'
];

angular
    .module('app')
    .config(routes);

})();
- [ ] ### ~~> [* - [ ] ]()~~

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants