Generating an entity

This generates a whole bunch of files that you can think of to work with an entity. To run the command, type:

ng generate entity product

The following files are generated:

  • product.actions.ts
  • product.model.ts
  • product.reducer.ts
  • product.reducer.spec.ts

It's worth mentioning that the product.reducer.ts file not only generates the full reducer function but also creates and initializes the EntityAdapter. That's a lot of boilerplate that you don't have to write. You also get all the actions and all selectors—a truly powerful command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.30.236