johnpapa / ngrx-data-lab

Sample app that can be expanded to use ngrx-data
216 stars 60 forks source link

Error when starting up app on step 7 #27

Open brane53 opened 5 years ago

brane53 commented 5 years ago

I went through all the steps in the quickstart guide but got an error when I ran step 7. I went back through and realized the guide didn't have a step for importing the AppStoreModule into the AppModule. It's a pretty simple thing to overlook, and once I did that everything worked fine.

huddlestonka commented 5 years ago

Same here. importing AppStoreModule in app.module.ts resolved the following error:

ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppDevModule)[HeroService -> EntityCollectionServiceElementsFactory]: StaticInjectorError(Platform: core)[HeroService -> EntityCollectionServiceElementsFactory]: NullInjectorError: No provider for EntityCollectionServiceElementsFactory! Error: StaticInjectorError(AppDevModule)[HeroService -> EntityCollectionServiceElementsFactory]: StaticInjectorError(Platform: core)[HeroService -> EntityCollectionServiceElementsFactory]: NullInjectorError: No provider for EntityCollectionServiceElementsFactory! at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:717) at resolveToken (core.js:954) at tryResolveToken (core.js:898) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:795) at resolveToken (core.js:954) at tryResolveToken (core.js:898) at StaticInjector.push../nodemodules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:795) at resolveNgModuleDep (core.js:17739) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (core.js:18428) at resolveNgModuleDep (core.js:17739) at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:717) at resolveToken (core.js:954) at tryResolveToken (core.js:898) at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:795) at resolveToken (core.js:954) at tryResolveToken (core.js:898) at StaticInjector.push../nodemodules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:795) at resolveNgModuleDep (core.js:17739) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (core.js:18428) at resolveNgModuleDep (core.js:17739) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:14134) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595)

alekline commented 5 years ago

Please note this was also asked and closed in Issue 25: https://github.com/johnpapa/ngrx-data-lab/issues/27

mj-interactive commented 5 years ago

With @angular/cli v7, do we need to use this to create the App Store Module? (notice the = used to specify the module to import in)

ng g m store/app-store --flat -m=app --spec false

Worked for me.

lhaisrs commented 5 years ago

Don't forget to import NgrxDataModule.forRoot(entityConfig) in AppStoreModule (store/app-store.module.ts) and import AppStoreModule in app.module.ts