Crud Collection
import { Injectable } from '@angular/core';
import { CrudCollection, CrudCollectionState } from '@frrri/ngxs-crud';
interface Post {
id: string;
body: string;
title: string;
}
@CrudCollection({ name: 'posts' })
@Injectable()
export class PostsState extends CrudCollectionState<Post, Post['id']> { }Global customisation
...
@NgModule({
...
providers: [
...
{
provide: CRUD_COLLECTION_OPTIONS_TOKEN,
useValue: {
baseUrl: 'http://localhost:3000',
} as CrudCollectionOptionsProvider,
}
],
})
export class StateModule { }Last updated