Created
September 23, 2015 05:16
-
-
Save jimthedev/29ac38a7734d64838e79 to your computer and use it in GitHub Desktop.
Revisions
-
jimthedev created this gist
Sep 23, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ { "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>", " <id>${1:dashed-name} {{id}}</id>:", " <!-- <example-list></example-list> -->", " </${1:dashed-name}-contents>", " `", "})", "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." } }