Skip to content

$stateRegistry.onStatesChanged does not fire for lazy loaded states referenced by non-lazy loaded state #170

Closed
@christopherthielen

Description

@christopherthielen

From @blah238 on April 22, 2018 4:25

This is a (check one box):

  • Bug Report
  • Feature Request
  • General Query

My version of UI-Router is:

angular: 1.6.5
@uirouter/core: 5.0.11
@uirouter/angularjs: 1.0.11

Bug Report

Current Behavior:

If a parent state is declared within a lazyLoad function and a descendant state declaration references this state outside of a lazyLoad function, the $stateRegistry.onStatesChanged event is not triggered for the lazy loaded state.

Expected Behavior:

I would expect a lazy loaded state to have the $stateRegistry.onStatesChanged event triggered even if it is referenced by a non lazy loaded state declaration.

Link to Plunker or stackblitz that reproduces the issue:

https://stackblitz.com/edit/ui-router-angularjs-ejwh3n?file=app.js

Repro steps:

  1. Toggle the Console window and look for the messages about states being registered
  2. Click the lazy link at the top.
  3. Note that the message for the lazy state being registered is missing unless you comment out line 41.

Copied from original issue: angular-ui/ui-router#3682

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions