-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Type declaration for ActivatedRoute.fragment doesn't declare possible null values #23894
Copy link
Copy link
Closed
Closed
Copy link
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerbreaking changesfreq3: highopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).state: confirmedstate: has PRtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
Current behavior
The type declaration for ActivatedRoute.fragment declares that it will emit string instances and nothing else.
interface ActivatedRoute {
fragment: Observable<string>
}To my surprise, it emits null values for routes that don't have a fragment.
Expected behavior
I see three valid options here (in no particular order):
- emit
''instead ofnullfor missing fragments - don't emit at all for missing fragments
- just change the type declaration to
Observable<string | null>
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
Angular version: 5.2.9
Browser:
- [x] Chrome (desktop) version 65
- [x] Firefox version 59
Others:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: routerbreaking changesfreq3: highopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).state: confirmedstate: has PRtype: bug/fix
