angular create interface code example

Example 1: how to declare interface object in angular 11

var myObject = {} as IObject
var myListObject = [] as Array

Example 2: angular cli interface generate

ng generate interface   [options]
ng g interface   [options]

# 	The name of the interface.
# 	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

Tags:

Misc Example