Skip to content

router-outlet's misbehaviour in @angular/router 4.4.4 #1025

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

Closed
Liooo opened this issue Oct 6, 2017 · 6 comments
Closed

router-outlet's misbehaviour in @angular/router 4.4.4 #1025

Liooo opened this issue Oct 6, 2017 · 6 comments

Comments

@Liooo
Copy link

Liooo commented Oct 6, 2017

After upgrading angular things to 4.4.4, router-outlet started misbehaving.
I have the following routes

  { path: 'home', component: HomeComponent, canActivate: [AuthGuard], children: [
    { path: 'list', component: AssignmentListComponent, outlet: 'assignmentsOutlet'},
    { path: 'detail/:id', component: AssignmentDetailsComponent, outlet: 'assignmentsOutlet'}
  ]}

HomeComponent's view is looking like this.

<TabView
  [(ngModel)]="selectedIndex"
  (selectedIndexChanged)="tabViewIndexChange(tabView.selectedIndex)">

  <StackLayout *tabItem="{title: 'assigments'}">
    <router-outlet name="assignmentsOutlet"></router-outlet>
  </StackLayout>
   ..

and when I navigate from '/home/list' to 'detail/:id', by

router.navigate(['/home', {outlets: { assignmentsOutlet: ['detail', 1] } }])

I see AssignmentDetailsComponent's view ABOVE AssignmentListComponent's one, rather than the prior replacing the latter.
Reverting the angular version fixed the problem so I'm assuming it's an issue introduced by the update.

package.json before (which is working)

    "@angular/animations": "~4.2.0",
    "@angular/common": "~4.2.0",
    "@angular/compiler": "~4.2.0",
    "@angular/core": "~4.2.0",
    "@angular/forms": "~4.2.0",
    "@angular/http": "~4.2.0",
    "@angular/platform-browser": "~4.2.0",
    "@angular/router": "~4.2.0",
    "nativescript-angular": "^4.2.0",
    "tns-core-modules": "^3.2.0",

package.json after (which is not working)

    "@angular/animations": "~4.4.4",
    "@angular/common": "~4.4.4",
    "@angular/compiler": "~4.4.4",
    "@angular/core": "~4.4.4",
    "@angular/forms": "~4.4.4",
    "@angular/http": "~4.4.4",
    "@angular/platform-browser": "~4.4.4",
    "@angular/router": "~4.4.4",
    "nativescript-angular": "^4.2.0",
    "tns-core-modules": "^3.2.0",
@danielgek
Copy link

@Liooo i think [email protected] can only be used with angular 4.2.x, next version will support angular 4.4.x

@Liooo
Copy link
Author

Liooo commented Oct 6, 2017

@danielgek Thank you, probably that's it.
Maybe package.json's version and dependency should be fixed.

@jogboms
Copy link

jogboms commented Oct 10, 2017

@Liooo check this out #941

@NickIliev
Copy link

@Liooo can you confirm if the fix introduced here is resolving your issue

@Liooo
Copy link
Author

Liooo commented Oct 12, 2017

@jogboms @NickIliev sorry I just reverted back to 4.2.0 and still haven't tried the solution, will check it out and get back to you guys

@Liooo
Copy link
Author

Liooo commented Oct 18, 2017

@jogboms @NickIliev updating to [email protected] fixed it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants