Readonly
actionIs this a detailed action (in case of action API)? (default is false).
Optional
Readonly
actionAction name in case of action API.
Readonly
baseAPI base URL (default is CRUD_BASE).
Set this to override the injection token value.
Readonly
cacheEnable cache for list action? (default is false).
Cache is reset automatically when making these API calls:
Readonly
getMethod that returns an HTTP context instance to use for making API calls.
Optional
Readonly
mapMethod that changes the data from API response.
Readonly
nameAPI endpoint.
Optional
parentPk: PKPK of parent in case of action.
Full API endpoint URL.
Create a new file upload object.
Same as create but with FormData as payload.
File instance to append to the form. Uses name for the filename property of append.
Form data instance (defaults to
new FormData()
).
Optional
parentPk: PKPK of the parent in case of detail action CRUD instance.
CRUD API model for a typical DRF ModelViewSet.
Configuration
To configure Crud, injection tokens must be set. Tokens: CRUD_HTTP_CLIENT CRUD_BASE
Action Crud
From an existing Crud instance
Use the getAction method to create a new instance of Crud but specific for your action.
New Crud instance
For action views, you muse set Crud.actionName.
For detail action views, you must provide Crud.actionDetail and pass the parent PK in every method for API calls.
Generic Type Params
T is the type of data. LT is the type of data returned in list.