mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
refactor(http): add context property to httpResource (#60188)
This was an oversight, `context` can be supported out of the box. PR Close #60188
This commit is contained in:
parent
8b8e3fdca4
commit
bb14fe86e3
2 changed files with 7 additions and 0 deletions
|
|
@ -1741,6 +1741,7 @@ export interface HttpResourceRef<T> extends WritableResource<T>, ResourceRef<T>
|
|||
// @public
|
||||
export interface HttpResourceRequest {
|
||||
body?: unknown;
|
||||
context?: HttpContext;
|
||||
headers?: HttpHeaders | Record<string, string | ReadonlyArray<string>>;
|
||||
method?: string;
|
||||
params?: HttpParams | Record<string, string | number | boolean | ReadonlyArray<string | number | boolean>>;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import type {Injector, ResourceRef, Signal, ValueEqualityFn, WritableResource} f
|
|||
import type {HttpHeaders} from './headers';
|
||||
import type {HttpParams} from './params';
|
||||
import type {HttpProgressEvent} from './response';
|
||||
import {HttpContext} from './context';
|
||||
|
||||
/**
|
||||
* The structure of an `httpResource` request which will be sent to the backend.
|
||||
|
|
@ -50,6 +51,11 @@ export interface HttpResourceRequest {
|
|||
*/
|
||||
headers?: HttpHeaders | Record<string, string | ReadonlyArray<string>>;
|
||||
|
||||
/**
|
||||
* Context of the request stored in a dictionary of key-value pairs.
|
||||
*/
|
||||
context?: HttpContext;
|
||||
|
||||
/**
|
||||
* If `true`, progress events will be enabled for the request and delivered through the
|
||||
* `HttpResource.progress` signal.
|
||||
|
|
|
|||
Loading…
Reference in a new issue