Skip to content

remove redundant root in IDLE_SERVICE and document @defer new option#67444

Open
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
SkyZeroZx:docs/defer
Open

remove redundant root in IDLE_SERVICE and document @defer new option#67444
SkyZeroZx wants to merge 2 commits intoangular:mainfrom
SkyZeroZx:docs/defer

Conversation

@SkyZeroZx
Copy link
Contributor

  • Add docs for IdleService and customization for the @defer idle
  • Remove the providedIn: 'root' configuration from the IDLE_SERVICE token

…ICE`

Remove the `providedIn: 'root'` configuration from the `IDLE_SERVICE` token
since it is redundant and does not change the default injection behavior
@pullapprove pullapprove bot requested a review from thePunderWoman March 4, 2026 19:42
@SkyZeroZx SkyZeroZx changed the title remove redudant root in IDLE_SERVICE and document @defer new option remove redundant root in IDLE_SERVICE and document @defer new option Mar 4, 2026
@angular-robot angular-robot bot added area: docs Related to the documentation area: core Issues related to the framework runtime labels Mar 4, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 4, 2026
}

export const IDLE_SERVICE = new InjectionToken<IdleService>(ngDevMode ? 'IDLE_SERVICE' : '', {
providedIn: 'root',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to InjectionToken, the default is root

this.ɵprov = ɵɵdefineInjectable({
token: this,
providedIn: options.providedIn || 'root',
factory: options.factory,
});

Also similar to a previous cleanup #65057

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see. Thanks for the clarification. REQUEST CHANGES!!!!

JKJK

Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM

@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime area: docs Related to the documentation target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants