ReadonlyactionIs this a detailed action (in case of action API)? (default is false).
Optional ReadonlyactionAction name in case of action API.
ReadonlybaseAPI base URL (default is CRUD_BASE).
Set this to override the injection token value.
Private OptionalcacheLast cache value stored for list action. Works only when cache is enabled for this crud.
ReadonlycacheEnable cache for list action? (default is false).
Cache is reset automatically when making these API calls:
ReadonlygetMethod that returns an HTTP context instance to use for making API calls.
Private ReadonlyhttpMust be set in API service before usage.
Private ReadonlyinjectorInjector instance to get Angular injections.
Optional ReadonlymapMethod that changes the data from API response.
ReadonlynameAPI endpoint.
ReadonlyonTriggered when an API call is made.
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()).
OptionalparentPk: 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.