Skip to content

fix(angular): NavController works with nested outlets - #28421

Merged
liamdebeasi merged 5 commits into
mainfrom
FW-5459
Oct 27, 2023
Merged

fix(angular): NavController works with nested outlets#28421
liamdebeasi merged 5 commits into
mainfrom
FW-5459

Conversation

@liamdebeasi

@liamdebeasi liamdebeasi commented Oct 26, 2023

Copy link
Copy Markdown
Contributor

Issue number: resolves #28417


What is the current behavior?

The common IonRouterOutlet was trying to inject another common IonRouterOutlet into parentOutlet:

@SkipSelf() @Optional() readonly parentOutlet?: IonRouterOutlet
None existed, so this field was null.

This is a problem if developers are using the module IonRouterOutlet since parent router outlets will not be currently injected because Angular is trying to use the common IonRouterOutlet not the module IonRouterOutlet: https://github.com/ionic-team/ionic-framework/blob/main/packages/angular/src/directives/navigation/ion-router-outlet.ts. The same goes for the standalone IonRouterOutlet.

This resulted in things such as NavController.pop not working in nested outlets because the parentOutlet was not defined.

What is the new behavior?

  • IonRouterOutlet now injects the correct router outlet instance for parentOutlet

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 7.5.3-dev.11698328998.1a79f815

@github-actions github-actions Bot added the package: angular @ionic/angular package label Oct 26, 2023
@liamdebeasi
liamdebeasi marked this pull request as ready for review October 26, 2023 14:23

@thetaPC thetaPC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread packages/angular/test/base/e2e/src/lazy/nested-outlet.spec.ts
Comment thread packages/angular/test/base/e2e/src/standalone/tabs.spec.ts
@liamdebeasi
liamdebeasi added this pull request to the merge queue Oct 27, 2023
Merged via the queue into main with commit 90acad1 Oct 27, 2023
@liamdebeasi
liamdebeasi deleted the FW-5459 branch October 27, 2023 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: angular @ionic/angular package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: NavController.pop not working in nested outlets

3 participants