Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use ngrx-schematics in an Ionic 4 project?

Tags:

I'm trying to use ngrx-schematics within an Ionic 4 project, but I can't seem to make it work.

Just started an Ionic 4 project and installed ngrx store, entity, effects and schematics. I also have globally installed angular-cli 8, although Ionic still uses version 7. I found on the web ways to make ngrx-schematics work with Ionic 3 by creating a angular-cli.json file with some configuration. I think that, since Angular 6, that file no longer exists on angular projects, so I didn't create it.

I ran the command ng config schematics.colection @ngrx/schematics so I could integrate angular schematics with ngrx schematics. Unfortunately, it didn't work, because when I tried to create a store with the command ng g store State --root --module app.module.ts I get the following error: Error: Schematic "store" not found in collection "@ionic/angular-toolkit".

like image 683
Rodrigo Silva Avatar asked Jun 07 '19 18:06

Rodrigo Silva


People also ask

What is angular CLI schematics?

The Angular CLI uses schematics to apply transforms to a web-app project. You can modify these schematics, and define new ones to do things like update your code to fix breaking changes in a dependency, for example, or to add a new configuration option or framework to an existing project.


1 Answers

The new way of adding schematics(here ngrx/schematics) would be ng config cli.defaultCollection @ngrx/schematics. Here is the reference

like image 121
KiraAG Avatar answered Nov 15 '22 06:11

KiraAG