There seems to be a lot of confusion about Implement NgRX 4 and above in an Angular application. Some of it I’ve contributed to because NgRX 2 isn’t quite the same as NgRX 4 and as I’ve transitioned, I’ve learned better ways. In other words, I was wrong and I’m correcting my mistake! Below is the correct, NgRX approved way, of implementing NgRX 4.
If you are looking for information about how to convert to NgRX 4 from NgRX 2, you can visit my previous article, How to Upgrade to NgRX 4.
Before we get started, make sure you have TypeScript 2.4.x or above installed in your local project. The CLI may complain, depending on what version of it you are using. But, NgRX 4 requires us to use TypeScript 2.4.x. You should also have RxJS 5.4.x or above installed.
You will also need to install @ngrx. You can do this using the following NPM command:
1 | npm install --save @ngrx/store @ngrx/effects |
And finally, I’ve found that I need to use the –aot switch both when I’m using production and development builds, so you’ll want to add that to your scripts in your package.json file. 
Photo via 




Photo via 
Photo via