{"action":"closed","issue":{"url":"https://api.github.com/repos/ui-router/angular-hybrid/issues/86","repository_url":"https://api.github.com/repos/ui-router/angular-hybrid","labels_url":"https://api.github.com/repos/ui-router/angular-hybrid/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/ui-router/angular-hybrid/issues/86/comments","events_url":"https://api.github.com/repos/ui-router/angular-hybrid/issues/86/events","html_url":"https://github.com/ui-router/angular-hybrid/issues/86","id":297099795,"number":86,"title":"Nested child state not automatically entered after deferIntercept","user":{"login":"oliverguenther","id":459462,"avatar_url":"https://avatars3.githubusercontent.com/u/459462?v=4","gravatar_id":"","url":"https://api.github.com/users/oliverguenther","html_url":"https://github.com/oliverguenther","followers_url":"https://api.github.com/users/oliverguenther/followers","following_url":"https://api.github.com/users/oliverguenther/following{/other_user}","gists_url":"https://api.github.com/users/oliverguenther/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverguenther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverguenther/subscriptions","organizations_url":"https://api.github.com/users/oliverguenther/orgs","repos_url":"https://api.github.com/users/oliverguenther/repos","events_url":"https://api.github.com/users/oliverguenther/events{/privacy}","received_events_url":"https://api.github.com/users/oliverguenther/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-14T13:43:09Z","updated_at":"2018-02-14T14:08:27Z","closed_at":"2018-02-14T14:08:26Z","author_association":"NONE","body":"I'm currently in the process of migrating our large hybrid Rails/AngularJS application to Angular (4.5.0 at the time of this writing). First of all, an explicit thanks for the effort put into the hybrid ui-router, it makes our transition bearable.\r\n\r\nWe already have several downgraded components under our - currently all ng1 - entry states registered in ui-router. Among them are an abstract base state `work-packages` and a child state `work-package.list` which are entered when accessing the page `/work_packages`\r\n\r\n```\r\n    $stateProvider\r\n      .state('work-packages', {\r\n        url: '/work_packages?query_id&query_props',\r\n        abstract: true,\r\n        params: { ... },\r\n        templateUrl: '/components/routing/main/work-packages.html',\r\n        controller: 'WorkPackagesController'\r\n      })\r\n      .state('work-packages.list', {\r\n        controller: 'WorkPackagesListRouter', // Wrapper component in ng1 to be used with @ui-router/angularjs\r\n        template: '<wp-list></wp-list>', // wp-list is a ng2 component\r\n      })\r\n```\r\n(There are more child and sibling states in this definition, abbreviated here for legibility. Full reference in https://github.com/opf/openproject/blob/dev/frontend/app/components/routing/ui-router.config.ts#L90)\r\n\r\nThis setup is working fine with `@uirouter/angularjs 1.0.13` and some wrapped components as long as all entry components are ng1.\r\n\r\nNow, using `@uirouter/hybrid` and the `deferIntercept` approach with all states and entry components being unchanged ng1, neither of the above state is now entered as they were before. However, when I manually inject `$state` and execute the transition `$state.go('work-packages.list')`, the page loads fine. I suspect that the `url.sync()` does not properly happen to set the correct current state according to the URL. How can I force the state to be entered on initial page load?\r\n\r\nI am deferring the UI router by re-using the ng2 module bootstrapping code from your sample app:\r\n\r\n```\r\nng1Module\r\n  .config([ '$urlServiceProvider', ($urlServiceProvider:any) =>  $urlServiceProvider.deferIntercept() ])\r\n  .run(['$$angularInjector', ($$angularInjector:any) => {\r\n    const url:any = getUIRouter($$angularInjector).urlService;\r\n    url.listen();\r\n    url.sync();\r\n  }]);\r\n\r\n\r\nplatformBrowserDynamic()\r\n  .bootstrapModule(OpenProjectModule)\r\n  .then(platformRef =>(platformRef) {\r\n    const injector = platformRef.injector;\r\n    const upgradeModule = injector.get(UpgradeModule);\r\n\r\n    upgradeModule.bootstrap(document.body, [ ng1Module.name ], { strictDi: false });\r\n});\r\n\r\n\r\n"}}
{"actor":{"display_login":"oliverguenther"}}