mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Allows throwing from the resource's params function to transition the resource to a status other than resolved. In particular, the following values can be thrown from params: - `ResourceParamsStatus.IDLE` causes the resource to become `idle` (equivalent to returning `undefined`) - `ResourceParamsStatus.LOADING` causes the resource to become `loading` - Any `Error` object causes the resource to become `error` and report the error that was thrown via `.error()` To simplify chaining together resources, this PR also introduces a context object passed into to the `params` functon. This context contains a `chain` function that can be used to get the value of a resource that the params want to depend on, while automatically propagating the idle, loading, and erorr states of the resource forward. |
||
|---|---|---|
| .. | ||
| BUILD.bazel | ||
| client_spec.ts | ||
| context_spec.ts | ||
| fetch_spec.ts | ||
| headers_spec.ts | ||
| jsonp_mock.ts | ||
| jsonp_spec.ts | ||
| module_spec.ts | ||
| params_spec.ts | ||
| provider_spec.ts | ||
| request_spec.ts | ||
| resource_spec.ts | ||
| response_spec.ts | ||
| transfer_cache_spec.ts | ||
| xhr_mock.ts | ||
| xhr_spec.ts | ||
| xsrf_spec.ts | ||