Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Sibling routes #173

Description

@ulrikstrid

I'm trying to convert a app to the new router and I'm getting a error:

TypeError: Cannot read property 'toolbar' of undefined
    at getComponentFromInstruction (router.es5.js:91)
    at Object.router.registerViewport.instantiate (router.es5.js:103)
    at router.es5.js:1090
    at processQueue (angular.js:13189)
    at angular.js:13205
    at Scope.$get.Scope.$eval (angular.js:14401)
    at Scope.$get.Scope.$digest (angular.js:14217)
    at Scope.scopePrototype.$digest (hint.js:1468)
    at Scope.$get.Scope.$apply (angular.js:14506)
    at Scope.scopePrototype.$apply (hint.js:1478)

And then I'm getting the same for my other sibling routes.

My route config in AppController

$router.config([
    {path: '/', redirectTo: '/checkout'},
    {path: '/checkout', components: {main: 'checkout', search: 'search', toolbar: 'toolbar'}},
    {path: '/driver', components: {main: 'DriversView', search: 'search', toolbar: 'toolbar'}}
]);

I have viewports something like this:

<div ng-viewport="toolbar"></div>

My modules looks like this:

(function ()
{
    'use strict';

    angular
        .module('wetm', [
            //Angular modules
            'ngMaterial',
            'ngAnimate',
            'ngNewRouter',
            //3rd party modules

            //Mymodules
            'wetm.search',
            'wetm.toolbar',
            'wetm.checkout',
            'wetm.DriversView'
        ]);
});

(function ()
{
    'use strict';

    angular
        .module('wetm.toolbar', []);
})();

What am I doing wrong?
And is there any better way to have default components in viewports?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions