◐ Shell
reader mode source ↗
Skip to main content
menu
menuAPI
  • arrow_back API Reference
    • Overview
    • @angular/animations
    • @angular/animations/browser
    • @angular/animations/browser/testing
    • @angular/aria/accordion
    • @angular/aria/combobox
    • @angular/aria/grid
    • @angular/aria/listbox
    • @angular/aria/menu
    • @angular/aria/tabs
    • @angular/aria/toolbar
    • @angular/aria/tree
    • @angular/cdk/drag-drop
    • @angular/cdk/testing
    • @angular/cdk/testing/protractor
    • @angular/cdk/testing/selenium-webdriver
    • @angular/cdk/testing/testbed
    • @angular/common
    • @angular/common/http
    • @angular/common/http/testing
    • @angular/common/testing
    • @angular/common/upgrade
    • @angular/core
    • @angular/core/rxjs-interop
    • @angular/core/testing
    • @angular/elements
    • @angular/forms
    • @angular/forms/signals
    • @angular/forms/signals/compat
    • @angular/localize
    • @angular/localize/init
    • @angular/platform-browser
    • @angular/platform-browser-dynamic
    • @angular/platform-browser-dynamic/testing
    • @angular/platform-browser/animations
    • @angular/platform-browser/animations/async
    • @angular/platform-browser/testing
    • @angular/platform-server
    • @angular/platform-server/testing
    • @angular/router
    • @angular/router/testing
    • @angular/router/upgrade
    • @angular/service-worker
    • @angular/ssr
    • @angular/ssr/node
    • @angular/upgrade
    • @angular/upgrade/static
    • @angular/upgrade/static/testing
    • window.ng globals
@angular/core

BaseResourceOptions

interface
stablesince v22.0

Options to the resource function, for creating a resource.

API

    
      interface BaseResourceOptions<T, R> {  params?: ((ctx: ResourceParamsContext) => R) | undefined;  defaultValue?: NoInfer<T> | undefined;  equal?: ValueEqualityFn<T> | undefined;  injector?: Injector | undefined;  id?: string | undefined;}
    
    

params

((ctx: ResourceParamsContext) => R) | undefined

A reactive function which determines the request to be made. Whenever the request changes, the loader will be triggered to fetch a new value for the resource.

If a params function isn't provided, the loader won't rerun unless the resource is reloaded.

defaultValue

NoInfer<T> | undefined

The value which will be returned from the resource when a server value is unavailable, such as when the resource is still loading.

equal

ValueEqualityFn<T> | undefined

Equality function used to compare the return value of the loader.

injector

Injector | undefined

Overrides the Injector used by resource.

id

string | undefined

Identifier used to cache the resource data in the TransferState during server-side rendering and to retrieve it on the client side. This value value needs to be identical for both the client and server.

Jump to details