• Overview
@angular/core

Resource

interface

A Resource is an asynchronous dependency (for example, the results of an API call) that is managed and delivered through signals.

  
    interface Resource<T> {}
  
  

value

Signal<T | undefined>

The current value of the Resource, or undefined if there is no current value.

The current status of the Resource, which describes what the resource is currently doing and what can be expected of its value.

error

Signal<unknown>

When in the error state, this returns the last known error from the Resource.

isLoading

Signal<boolean>

Whether this resource is loading a new value (or reloading the existing one).

hasValue

boolean

Whether this resource has a valid current value.

This function is reactive.

@returnsboolean

reload

boolean

Instructs the resource to re-load any asynchronous dependency it may have.

Note that the resource will not enter its reloading state until the actual backend request is made.

@returnsboolean
Jump to details