Collection
By extending your State with CollectionState and adding the @HttpCollection decorator, you are all set to communicate with your api via the provided defaults /api/{collection name}
. If you chose to consume data from somewhere else, you can always implement your own data layer to replace @ng-frrri/ngxs-http.
posts.state.ts
Global customisation
You can fully customise the baseUrl, endpoint and other relevant things via the @CrudCollection decorator's options, or globally for all collections by providing COLLECTION_OPTIONS_TOKEN anywhere in your module.
Overriding defaults for every @CrudCollection globally:
state.module.ts
Last updated