Skip to content

Instantly share code, notes, and snippets.

@DakotaLMartinez
Last active September 22, 2016 20:02
Show Gist options
  • Save DakotaLMartinez/d5ce20712ac5bc792ee3d1694427e3fc to your computer and use it in GitHub Desktop.
Save DakotaLMartinez/d5ce20712ac5bc792ee3d1694427e3fc to your computer and use it in GitHub Desktop.
Visual Studio Code Snippet to create an Angular 1 Component
"Angular Component": {
"prefix": "ng1component",
"body": [
"(function() {",
"\t'use strict';",
"\t// Usage:",
"\t//",
"\t// Creates:",
"\t//",
"",
"\tvar ${Component} = {",
"\t\tbindings: {",
"\t\t\t${property}: '='",
"\t\t},",
"\t\ttemplateUrl: 'views/${component-template}.html',",
"\t\tcontroller: ${Component}Controller,",
"\t\tcontrollerAs: '${vm}'",
"\t};",
"",
"\t${Component}Controller.$inject = ['${dependency1}']",
"\tfunction ${Component}Controller (${dependency1}) {",
"\t\t$0",
"\t}",
"",
"\tangular",
"\t\t.module('${Module}')",
"\t\t.component('${componentName}', ${Component});",
"",
"})();"
],
"description": "Angular 1 component"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment