States Registry
@CrudCollection({
name: 'posts'
})
export class PostsState extends CrudCollectionState { }
@CrudEntities({
name: 'entities',
children: [PostsState]
})
export class EntitiesState extends CrudEntitiesState { }StatesRegistryService
import { StatesRegistryService } from '@frrri/ngxs-crud/registry';
@Component(...)
export class AppComponent {
constructor(private registry: StatesRegistryService) {
const entitiesState = this.registry.getByPath<EntitiesState>('entities');
const postsState = this.registry.getByPath<PostsState>('entities.posts');
...
}
}Last updated