auto generate component angular code example

Example 1: creare component in anglar

ng generate component [component-name]

Example 2: angular cli interface generate

ng generate interface <name> <type> [options]
ng g interface <name> <type> [options]

# <name>	The name of the interface.
# <type>	Adds a developer-defined type to the filename, in the format "name.type.ts".
# [options]
#	--lintFix=true|false	When true, applies lint fixes after generating the interface (Default: false)
#	--prefix=prefix			A prefix to apply to generated selectors
#	--project=project		The name of the project.

# e.g.
# ng generate interface Itest sometype		generates file name		itest.sometype.ts

Example 3: auto generate component angular

ng g component [directory-where-you-want-to-save-the-component]/[new-component-name]

ng generate component [directory-where-you-want-to-save-the-component]/[new-component-name]

Tags:

Misc Example