Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property '$type' of undefined #10

Closed
hrgui opened this issue Mar 7, 2018 · 3 comments
Closed

TypeError: Cannot read property '$type' of undefined #10

hrgui opened this issue Mar 7, 2018 · 3 comments

Comments

@hrgui
Copy link
Contributor

hrgui commented Mar 7, 2018

https://github.com/ui-router/react-hybrid/blob/master/src/decorateUIRouterViewConfigs.ts#L34

.state('account.view.list', {
        url: '/list?new&updated&sortBy',
        title: title,
        views: {
          'sub_header@': accountRoutesHelperServiceProvider.getAccountDetails(),
          '': {templateUrl: 'someTemplate.html'}
 const view = views[key];
      const selfView = selfViews[key];

In views, it gets defined as '$default', but selfViews define it as ''; what is the expected behavior here?

Is the state definition wrong: should I update it to '$default'?

===
From https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views:

     // Relatively targets the unnamed view in this state's parent state, 'contacts'.		
        // <div ui-view/> within contacts.html		
        "" : { }, 		

https://github.com/angular-ui/ui-router/blob/b2b906b0ad45f06ed114b0c042bdc60a176c60a8/src/statebuilders/views.ts#L56

@hrgui
Copy link
Contributor Author

hrgui commented Mar 8, 2018

I did find a workaround:

In my AngularJS definitions, everytime I see views[''], I would have to update it to views['$default']

@kwalker3690
Copy link

We're also running into this issue, would love to know if the workaround prescribed here is the suggestion, or if this can be fixed within the repo itself.

@kwalker3690
Copy link

I'm not sure this was actually solved - as mentioned here by the commit author, this relevant commit was somehow not merged: 323faf1#diff-27859f2b9609526b65d934ba68e2dbd1R35

I'm on v0.3.0 and still experiencing this issue. Please reopen the issue or share further context as to how it should remain closed! Thanks for the help in advance.

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

No branches or pull requests

2 participants