Questions tagged [angular-state-managmement]
51 questions
0
votes
1 answer
Keep state of previous page in Angular 10
im reading data in component A, route to component B and pass data as extras.
Component B now has this data in its instance scope. I then pass this data to component C and do something with that data. If I now return to component B by going back a…
0
votes
1 answer
NGXS: loading and error messages in state
I'm new to NGXS and right now i'm trying to add on each of my state a loading and an error object. The easiest way would be to add a loading: boolean and an errors: {} on my state model.
But I decided to create another state named ApiRequestState…

Jed
- 1,054
- 1
- 15
- 34
0
votes
1 answer
Updating selected entities updates all entities in ngneat/elf repository
I'm facing an issue where I try to update an entity in the store but every entity gets updated instead.
Now I have defined the entities and their ids as such:
const { state, config } = createState(
withEntities

Patrick Deisinger
- 31
- 1
0
votes
2 answers
Does NGXS check the store before fetching from the API?
So, I'm trying to use NGXS for the first time, and I noticed that when I add the following code in Angular's ngOnInit() function, it always fetches the API:
this.store.dispatch(new FooActions.GetAll());
This might seem like a stupid question but,…

Jed
- 1,054
- 1
- 15
- 34
0
votes
1 answer
NGXS state returns object instead of actual data
I'm new to NGXS. So just to test, i've tried the simple setup on simple test app where you import the state in the app component using the forRoot and everything works fine.
Now I have a slightly bigger app and i've found the forFeature function for…

Jed
- 1,054
- 1
- 15
- 34
0
votes
1 answer
Angular/NGXS - can't get store state
On the parent component I'm dispatching an action, I am willing to get the dispatched array on the child, for that I am doing the following:
export class ListComponent implements OnInit {
@Select(ProductState.getProductDetails) listProduct$:…

Folky.H
- 1,164
- 4
- 15
- 37
0
votes
0 answers
BehaviourSubject's new value not reflected in observable in inheritance
i am building an angular architecture somewhat similar to this :
https://blog.angular-university.io/how-to-build-angular2-apps-using-rxjs-observable-data-services-pitfalls-to-avoid/
I have simply a base class for managing state which manages state…

Abdullah Sohail
- 355
- 4
- 8
0
votes
0 answers
Call signature return types '{ aside: boolean; spinner: boolean; user: User; }' and 'SharedState' are incompatible. Angular11
I'm learning state management in Angular11. When I try to make a reducer I have got an error.
Argument of type '(state: SharedState, action: { aside_status: boolean; } & TypedAction<"[ aside page ] aside"> & { type: "[ aside page ] aside"; }) => {…

Mohd Sabban
- 182
- 1
- 12
0
votes
1 answer
Unable to get latest state value using ngrx in Angular
Hello guys I am new to angular. These days I am trying to learn state management in angular. well, I tried following some tutorials but some of their code was already depreciated so I am a bit stuck in a problem. I am unable to get the latest state…

Zain Waheed
- 21
- 5
0
votes
0 answers
Why my selector function in NGXS receives null when the state has been populated?
I have an Ionic app with NGXS that I'm trying to setup.
I'm doing the Auth part.
So far I've this model:
export interface AuthStateModel {
profile: Profile | null;
loaded: boolean;
}
and this AuthState:
@State({
name: 'auth',
…

J4N
- 19,480
- 39
- 187
- 340
0
votes
0 answers
Angular - Sharing data between components
As I am getting deeper into Angular, im trying to implement the following situation, these are my components:
What I am trying to figure out is the ideal way of passing data from a child to the parent and some other component. I am able to do it…

Atakan Bal
- 27
- 7
0
votes
3 answers
Angular - NGXS problem with loading data before view
Have you encountered a problem when you route to component and loading a table. But table is empty without data.
I mean the component / table is displayed. Data as i can see are in state(seassion storage] and loaded. I am able to display them if i…

Daniel Vágner
- 538
- 3
- 19
0
votes
1 answer
Update State when another State Changes
Let's say I have a list of products that can be filtered by type when user selects a different type from a dropdown (there are other filters users can set as well but they aren't relevant to this example).
I have State A that holds the currently…

connorvo
- 761
- 2
- 7
- 21
0
votes
1 answer
Two Models in Angular for Passing & Display Data
I have a problem with using models in ngxs.
I have to use different model for passing data to api and getting data from the api
I have a Report model and NetIncome model basically. How will i able to integrate them since theres an error on my code.…

Joseph
- 7,042
- 23
- 83
- 181
0
votes
1 answer
how to edit form data with ngrx state management?error i get(Error trying to diff '[object Object]'. Only arrays and iterables are allowed"))
import { createFeatureSelector, createSelector, Action } from "@ngrx/store";
import { Tutorial } from '../models/tutorial.model';
import * as TutorialActions from '../actions/tutorial.actions';
import { EntityState, EntityAdapter,…

Rahman Sadik
- 17
- 2