-
Notifications
You must be signed in to change notification settings - Fork 75
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.go init the component twice #25
Comments
@christopherthielen i'm having this issue as well, it seems that this issue old. |
@christopherthielen Could you please take a look at this bug. Maybe is not a real one but i can't find a solution. I tried to use the example for checking if ngOnInit will be call twice but the example didn't work. I can't migrate my application because of this bug. Thanks !!! |
If a reproduction is posted I can try to fix it! |
(Excuse my english, i'm a french speaker) I tried to reproduce the bug first within your example code but the example didn't start. (Missing dependencies, no webpack config...) Maybe you could try by yourself with an onNgInit function inside a NG2 controller in your example. Call your NG2 route component with $state.go like i said in the initial post and console something. You'll see 2 output in the browser console. If you prefer to fix the example code, i could try by myself first to reproduce the bug Or tell me what i need to give you to help debugging thanks |
Do you have some news about this issue ? |
@marcpearson The example code should work now.
I added the |
@christopherthielen i have trace enabled it shows only one transition, but suddenly my components init twice, all of them. I'm living with that for now, until i migrate all my app to angular. I don't know how to reproduce too. |
@BenevidesLecontes I'd like to get the bottom of this. Would you be able to share your repository with me? I could sign an NDA if needed. |
@christopherthielen i'll try to eject a module from my app and share with you. Thanks for your effort. |
Also experiencing this. Only when navigating between states passed into UIRouterModule.forChild components defined within are initialized twice, breaking our application. Removing lazyloading does not seem to make a difference, same behavior when module is imported normally. Will appreciate any hints |
If a reproduction is posted I can try to fix it! |
Closing because I have no way to reproduce this. |
I want to migrate my ui-router Angular 1 application with ngUpgrade and ui-router-ng1-to-ng2
I have a angular 1 state define with a ES6 class component using the ng1-to-ng2 component way
When calling the state like this from a Angular 2 component:
this.uiRouter.stateService.go("accounting/transactions", null, {reload: true});
or like this from an Angular 1 component
$state.go("accounting/transactions", null, {reload: true});
I can see that my component is call twice because the ngOnInit output twice in the console
FYI, the application use a "app" view has parent and a child "main" view
The text was updated successfully, but these errors were encountered: