ngrx-store-localstorage
                                
                                
                                
                                    ngrx-store-localstorage copied to clipboard
                            
                            
                            
                        Data not stored in LocalStorage
Hi all, I have a problem with syncing the store in LocalStorage. First of all I have to mention that it is not a standard client-side Angular application. My app uses PHP server side rendering and Angular as modules that are lazy loaded. We use multi-page embedding strategy described here: https://blog.novatec-gmbh.de/angular-2-in-a-multi-page-application/
So the main PHP routing is done without hashes and when Angular does ngDoBootstrap hash is added to the URL and Angular module is lazy loaded.
My dev env is pure Angular app and syncing works perfectly fine. The problem occurs only with hybrid of PHP and Angular app.
I've also done a test with raw saving in LS -> window.localStorage.setItem('xxx', 'xxx'); and it also works just fine.
I'd be appreciate for any clues for that matter, with regards, Grzegorz.
I may have figured this out, try removing aot and build optimizer from your angular.json. I am not sure why it does not work with those options but it was giving me a headache and as soon as users refreshed the app, my state was gone.
The deal is to make it work with AOT.