NG.VII · Angular 22 practice question

A team uses httpResource in a new Angular 22 application without any custom interceptors or XSRF configuration. What is required in appConfig?

Choose one answer
Check answer and explanation

Correct answer: Nothing extra is needed because httpResource uses the globally available HttpClient.

Explanation

Nothing extra is needed because httpResource uses the globally available HttpClient; provideHttpClient(...) is only required when configuring features such as interceptors or XSRF options.

Common trap

There is no separate provideHttpResource() provider function; httpResource builds directly on HttpClient. Calling provideHttpClient() was required in older Angular setups, but httpResource now relies on the globally available HttpClient by default.

Source: Angular docs: Reactive data fetching with `httpResource` — `Using httpResource`
Checked against the cited text on 2026-11-25.

Report an error in this question