I was looking at the docs and became lost.
ng generate interface <name> <type>
However it doesn't tell what to put in for type. Like is it just a string, object, array, etc or can I specify properties like email:String username:String age:Number
?
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.
The Angular latest Official stable version is Angular v13. 2.5, which is released on 2nd March 2022.
Use the command ng --version (or ng -v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to find out the globally installed version of Angular. Use the npm list --depth 0 to find out the list of packages installed in the current folder.
Using Angular CLI
,
ng g i filename
will create a file by the name filename.ts
and
will have export interface filename {}
in it
ng generate will generate
filename <name>.<type>.ts
content:
export interface <name> { //camel case
}
ie
ng generate interface Itest sometype
generates
file name itest.sometype.ts
content
export interface Itest {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With