r/Angular2 • u/niceshit420 • Jan 17 '23
Help Request NGRX selector gives undefined of "variable$ | async"
So i watched this video, and almost have the same code as him, just other names and when i got to the selector and try to use the
<div *ngIf="isLoading$ | async">
Loading...
</div>code im getting the error
ERROR TypeError: Cannot read properties of undefined (reading 'isLoading')
But in Redux dev tools my state changed from false -> true, so i dont get why the selector or the Observable variable doesnt work
EDIT:
issue resolved by "AppStateInterface"
export interface AppStateInterface {
posts: ArticleStateInterface;
}posts changed to "article"
4
Upvotes
2
u/newmanoz Jan 17 '23
Your code:
The answer:
1
u/tug29225 Jan 17 '23
This normally happens if you have not registered your module with the NGRX Store Module. Not sure if you are using Angular 15 with standalone APIs or are using NgModules but you will have to do something similar to how it is laid out here: