{ "New NG2 Component (Item)": { "prefix": "ng2c", "body": [ "import {Component, View, CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/angular2';", "// import {ExampleListComponent} from '../example/example-list.component';", "", "@Component({", " selector: '${1:dashed-name}',", " properties: ['id']", "})", "@View({", " directives: [ CORE_DIRECTIVES, FORM_DIRECTIVES/*, ExampleListComponent*/],", " styles: [`", " ${1:dashed-name}-contents { }", " `],", " template: `", " <${1:dashed-name}-contents>", " ${1:dashed-name} {{id}}:", " ", " ", " `", "})", "export class ${2:CapitalCaseName}Component {", " constructor(${3:public serviceInjections:ServiceInjections}) {", " ${4://Press ESC to finish or Tab to start over}", " }", " onInit() {", " }", "}" ], "description": "Create a new Angular2 single item component in this file." }, "New NG2 Directive": { "prefix": "ng2d", "body": [ "import {Directive, ElementRef} from 'angular2/angular2';", "", "@Directive({", " selector: '[${1:selector}]' // using [ ] means selecting attributes", "})", "export class ${2:}Directive {", " constructor(element: ElementRef) {", " // simple DOM manipulation to set font size to x-large", " // `nativeElement` is the direct reference to the DOM element", " element.nativeElement.fontSize = 'x-large';$3", " }", "}" ], "description": "Create a new Angular2 directive in this file." }, "New Import": { "prefix": "imp", "body": [ "import {${1}} from '${2:moduleOrPath}';", "${3}" ], "description": "Import a module." }, "Import Standard Component": { "prefix": "impc", "body": [ "import {${1:CapitalCase}Component} from '../${2:dash-case}/${2:dash-case}.component';", "${3}" ], "description": "Import a module." } }