-
-
Notifications
You must be signed in to change notification settings - Fork 241
feat: introduce PageService #2111
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
Conversation
test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @edusperoni !
Nice improvements in the page-router-outlet
code as well.
Only small change request - can you change Destruct<a>ble
to Destruct<i>ble
Oops! Fixed it now! |
Triggering internal CI |
test |
@edusperoni Is this still part of the latest |
It seems it was removed in some cleanup. For the moment you can copy the code and put the class in the providers for your component, it should work without an issue. |
@edusperoni Thanks for checking! |
PR Checklist
What is the current behavior?
To detect navigation we have to manually inject page, listen to events and handle the subscriptions.
What is the new behavior?
Introduces a
PageService
that has:page
: reference to the current pageinPage: boolean
: Page is the currently displayed pageinPage$: Observable<boolean>
: will emit true/false when entering/leaving pagepageEvents$: Observable<NavigatedData>
: observable of page events (use withfilter
operator)example implementation:
The "RxJs way":
Provides an "angular way" of managing #374