samwx
10/20/2017 - 5:02 PM

Create angular components vscode snippet

Create angular components vscode snippet

{
	"Create angular es7 component": {
		"prefix": "ng-component",
		"body": [
			"class ${1:ClassName} {",
				"\tconstructor() {$7}",
			"}",
			"",
			"export const ${2:ClassNameComponent} = {",
				"\ttemplate: ${3:template},",
				"\tcontroller: $1,",
				"\tcontrollerAs: '$${4:ctrl}',",
				"\tbindings: {",
					"\t\t$5",
				"\t},",
				"\ttransclude: ${6:boolean},",
			"};"
		],
		"description": "Create a padronized es7 component fo angular"
	},
	"Create angular es7 component using decorator": {
		"prefix": "ng-decorator-component",
		"body": [
			"import { Component } from 'decorators';",
			"",
			"@Component({",
				"\tcontrollerAs: '$${1:ctrl}',",
				"\ttemplate: ${2:template},",
				"\ttransclude: ${3:boolean},",
				"\tinputs: [$4],",
				"\toutputs: [$5],",
			"})",
			"export class ${6:ClassName} {",
				"\tconstructor() { }",
			"}"
		],
		"description": "Create a padronized es7 component fo angular"
	}
}