In order to use @ngrx/store [ 2.2.1 ] and @ngrx/core [ 1.2.0 ] for state management in my sample Angular 2 [2.4.0] application I followed below steps
Added below import to root module
import { StoreModule } from '@ngrx/store';
3 Added below code in packages section of systemjs.config.js file
'@ngrx/core': {
main: 'bundles/core.umd.js',
format: 'cjs'
},
'@ngrx/store': {
main: 'bundles/store.umd.js',
format: 'cjs'
}
I am getting below error in browser console , when I browse to the website
Failed to load resource: the server responded with a status of 404 (Not Found) "http://localhost:62818/@ngrx/store/bundles/store.umd.js"
Any idea what needs to be modified to fix this issue.
The objective of this article is to provide a technical implementation of the NGRX for an application with a complexity that could benefit from adding feature store(s) in addition to the root store.
NgRx/store is a library for managing state in your Angular applications, it is a reactive state management library powered by RxJS. Similar to Redux, this library can be used to manage the flow of data throughout your application, when actions are dispatched, reducers act on them and mutate the store.
The ngrx/store module allows you to define a slice of the root application state per each Feature module. The result is a single Root application state object, containing all the slice of states collected from all loaded Feature modules in the application.
As @ estus mentioned , this was a path issue . Adding below lines to map section with correct path resolved the issue
'@ngrx/core': 'node_modules/@ngrx/core/bundles/core.umd.js',
'@ngrx/store': 'node_modules/@ngrx/store/bundles/store.umd.js',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With