This repository has been archived by the owner on Jan 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 312
ngrx/store not working when loading hardcoded data. #441
Comments
May i see the app.module.ts file ? |
@giwiro Here you go:
|
I managed to get this working by doing the following (note - this is not how the ngrx/store tutorial explains it - I'm unsure why their instructions don't work for me):
and the reducer function:
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to use ngrx/store in my Angular app for hours and I can't figure out what I'm doing wrong. It seems like my store items never get updated.
Here is my Store interface:
Item is a custom object - here is the model:
I have a service that acts as a central hub that contain the main 'items' array and a function 'loadItems()' that loads the data (called from another component):
and here is my main app component that calls 'loadItems';
and the html I am using to test to see if 'items' is ever updated (it's a simple div that draws a specific number of buttons based on the size of items, which after running my code and loading the manual data should be 2):
Any idea what is going on? I'm completely new to ngrx/store and the tutorials I've read haven't been too helpful - they all seem to have syntax errors and are sometimes outdated.
The text was updated successfully, but these errors were encountered: