angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.54k stars 3k forks source link

child states of lazy loaded future states get stuck in stateQueue #3836

Open alexgoff opened 3 years ago

alexgoff commented 3 years ago

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.

This is a (check one box):

My version of UI-Router is: 1.0.29

Bug Report

Current Behavior:

import { clientAdminLandingFutureState } from "./src/client-admin-landing/client-admin-landing.future-state"; import { proxyFutureState } from "./src/proxy/proxy-future-state";

const AppModule = module("appModule", []).config( / @ngInject /($stateRegistry, $stateProvider) => { $stateProvider.state('app', { abstract: true, views: { master: { templateUrl: '/templates/core/master-layout.html', controller: 'coreController' }, } });

    $stateRegistry.register(clientAdminLandingFutureState);
    $stateRegistry.register(proxyFutureState);

} );


- When logging $stateRegistry.stateQueue.queue through the onStatesChanged listener or through an $onInit the child future state is still queued:
`[self: {name: "proxy.**", parent: "clientAdmin", url: "/proxy", lazyLoad: ƒ, $$state: ƒ}]`

#### Expected Behavior:

If the parent state is already defined, the child state should be registered and not queued. If the child state is put into the queue, it should be registered after the parent state is registered. 

My thinking is that the double wildcard is preventing the child and parent names from matching

#### Link to Plunker or stackblitz that reproduces the issue:

See code sample above
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.