Skip to content

Application fails to bootstrap with two levels of dynamic params #1045

@ggoodman

Description

@ggoodman

When both a parent and child state define optional, dynamic parameters, the application fails to bootstrap.

  $stateProvider.state("parent", {
    url: "/?parentParam",
    templateUrl: "parent.html",
    params: {
      parentParam: {
        value: null,
        dynamic: true
      }
    },
    controller: function () {

    }
  });


  $stateProvider.state("parent.child", {
    url: "/child?childParam",
    templateUrl: "child.html",
    params: {
      childParam: {
        value: null,
        dynamic: true
      }
    },
    controller: function () {

    }
  });

Results in the following error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module plunker due to:
Error: Missing required parameter 'parentParam' in state 'parent.child'
    at http://run.plnkr.co/uyP1Fmf4JJCrTanq/ui-router.js:1845:17
    at forEach (https://ajax....<omitted>...1)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions