Scaffolding library for Angular applications using Akita.
Schematics provides CLI commands for generating files when building new features with Akita. Built on top of Schematics, this tool integrates with the Angular CLI.
Default Schematics Collection
@datorama/akita as the default collection in your Angular CLI project, add it to your
The package extend the default
@schematics/angular collection. If you want to set defaults for schematics such as generating components with
scss file, you must change the schematics package name from
Create a New Feature
The defauls feature will output an entity feature, you can choose between different kind of
- Default: A regular service with CRUD boilerplate.
- Http: A
NgEntityServicepowered by the HttpClient (requires @datorama/akita-ng-entity-service).
- Firebase: A
CollectionServicepowered by AngularFirestore (requires akita-ng-fire).
You can also generate the normal feature with the
The akita-schematics: prefix is only needed when the default collection isn't set to akita-schematics
Generate a Store
Generate a Query
Generate a Model
Generate a Service
Generate an NgEntityService
--spec option. For example:
--withModule to generate module and Akita component. (only for entity store)
Generate several stores under the same state folder
There might be a case when you need to have more than one store per feature. For example, you have a module "CRM", where you have a few entities, like addresses or contacts. So you want to have one single state folder under "CRM" and under that, for every store, a subfolder. Like this:
To do so, add the
--flat false to your commands: