Categories
Angular Answers

How to generate command model in Angular Project with Angular-CLI?

Spread the love

Sometimes, we want to generate command model in Angular Project with Angular-CLI.

In this article, we’ll look at how to generate command model in Angular Project with Angular-CLI.

How to generate command model in Angular Project with Angular-CLI?

To generate command model in Angular Project with Angular-CLI, we generate a class.

For instance, we run

ng generate class hero --type=model

to generate the hero model class.

We set the type option to model to generate a model class.

Then we get the hero.model.ts file as a result.

Conclusion

To generate command model in Angular Project with Angular-CLI, we generate a class.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *