Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the interface type format in the angular cli?

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?

like image 959
jemiloii Avatar asked Apr 25 '17 14:04

jemiloii


People also ask

What is Angular command line interface?

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.

What is the latest version of Angular CLI?

The Angular latest Official stable version is Angular v13. 2.5, which is released on 2nd March 2022.

How do you check if Angular CLI is installed?

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.


2 Answers

Using Angular CLI,

ng g i filename

will create a file by the name filename.ts and will have export interface filename {} in it

like image 60
Ramya Avatar answered Oct 18 '22 00:10

Ramya


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 {
}
like image 15
Ahmed Musallam Avatar answered Oct 18 '22 01:10

Ahmed Musallam