renovate[bot] on all
chore(deps): update all depende… (compare)
markwhitfeld on master
build: remove failing script in… (compare)
renovate[bot] on all
chore(deps): update all depende… (compare)
arturovt on warn-unhandled-actions
feat(store): warn on unhandled … (compare)
arturovt on revert-select-decorator-changes
fix: cure hello-world-12-ivy in… (compare)
arturovt on revert-select-decorator-changes
fix: cure hello-world-14-ivy in… (compare)
arturovt on revert-select-decorator-changes
fix: cure hello-world-13-ivy in… (compare)
arturovt on revert-select-decorator-changes
fix: cure hello-world-12-ivy in… (compare)
export class DocumentationStateModel {
}
@State<DocumentationStateModel>({
name: 'documentation',
children: [
DocumentsState, ProcessesState
]
})
export class DocumentsStateModel {
currentDocument: string | null;
error: string | string[];
loading: boolean;
document: Document[];
}
@State<DocumentsStateModel>({
name: 'document',
defaults: {
currentDocument: null,
error: '',
loading: false,
document: []
}
})
Hi Guys,
I have some queries regarding NGXS implementation.
I have one object like this :
{
id : 1,
name : test,
language :
[
{ id : 1, name : "English" }, { id : 2, name : "French" }
],
task : [
{ id: 1, name: 'drawing', id: 2, name: 'cooking'}
]
}
I have parent component and its children components are using this object to display data like language component is displaying the languages and faciliates the CRUD operation on language. Same for task.
So how can I implement NGXS for this use case.
I have tried by creating the one state but it is too bulky because now it contains too many actions, state functions in one file.
Another one I am thinking of substate. But I don't know how to follow this approach with this object.
It would be nice if someone could help me. Waiting for your fast response.
Thanks
Another interesting question:
Given a simple CRUD app with following routes:
// list-routing.module.ts
[
{path: 'list', component: ListComponent},
{path: 'list/:itemId', component: ListItemComponent},
]
// list.tate.ts
@State({
name: 'list',
defaults: {
item: {
model: {
id: '',
name: '',
},
error: null,
}
}
})
export class ListState {
// selects, selectors & actions
}
In addition I'm using router serializer as described here. Maybe it's possible to update the form with the help of RouterStateParams
.
<!-- ListComponent -->
<ul>
<li *ngFor="let item of items" [routerLink]="'list' + item.id">{{item.name}}</li>
</ul>
<!-- ListItemComponent -->
<form [formGroup]="form" ngxsForm="list.item">
<input formControlName="name">
</form>
How to set the form on page refresh for the URL list/1
WITHOUT using ActivatedRoute in ListItemComponent?