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

state definition - non-url params require url to be defined #2025

Closed
fgarit opened this issue Jun 9, 2015 · 1 comment
Closed

state definition - non-url params require url to be defined #2025

fgarit opened this issue Jun 9, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@fgarit
Copy link

fgarit commented Jun 9, 2015

Hi,

I am using the state params property to define non-url params as such:

$stateProvider
        .state('site', {
          abstract: true,
          // url: '', // try uncommenting this line ----------------------------
          template: '<ui-view/>',
          params: {
            siteParam: null,
          },
        })
        .state('site.home', {
          url: '/home',
          templateUrl: 'tpl.html'
        })
        .state('site.page', {
          url: "/page",
          templateUrl: 'tpl.html'
        });

The problem is that the siteParam will only be populated, if the url is defined.

I don't know if this is by design. I can't really tell from reading the doc.

I've done a plunkr to illustrate:
http://plnkr.co/edit/o9ZfAAvF1eQBIcVa7BNg

If you uncomment line 14 in script.js, you'll see the siteParam is populated.

This is actually not a big deal for me, since setting:

{
  ...
  abstract: true,
  url: '',
  ...
}

works fine for my needs.

Thanks,

@christopherthielen christopherthielen added this to the 0.2.16 milestone Jun 9, 2015
@christopherthielen christopherthielen self-assigned this Jun 9, 2015
@christopherthielen
Copy link
Contributor

verified, thanks for the report

@christopherthielen christopherthielen modified the milestones: 0.2.16, after 0.2.17 Jan 25, 2016
ExpFront pushed a commit to ExpFront/ui-router that referenced this issue Jun 23, 2016
The parameters are now applied when transitioning to a child state.
Closes angular-ui#2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants