States Registry
@HttpCollection({
name: 'posts'
})
export class PostsState extends CollectionState { }
@CrudEntities({
name: 'entities',
children: [PostsState]
})
export class EntitiesState extends CrudEntitiesState { }StatesRegistryService
import { FRRRI_STATES_REGISTRY, StatesRegistry } from '@ng-frrri/router-middleware';
@Component(...)
export class AppComponent {
constructor(
@Optional() @Inject(FRRRI_STATES_REGISTRY) private statesRegistryService: StatesRegistry,
) {
const entitiesState = this.registry.getByPath<EntitiesState>('entities');
const postsState = this.registry.getByPath<PostsState>('entities.posts');
...
}
}Last updated