Skip to content

Instantly share code, notes, and snippets.

@billyma128
Last active November 9, 2017 08:19
Show Gist options
  • Save billyma128/60a9def5115b94ff5eed7d820bddd940 to your computer and use it in GitHub Desktop.
Save billyma128/60a9def5115b94ff5eed7d820bddd940 to your computer and use it in GitHub Desktop.
{
  "AngularJS Component": {
    "prefix": "ngc",
    "description": "AngularJS component",
    "body": [
      "export class ${1:Component}Controller implements ng.IComponentController {",
      "\n\tstatic \\$inject: string[] = ['\\$q', '\\$location', '\\$routeParams', 'dataService'];\n",
      "\t$0\n",
      "\tconstructor(",
      "\t\tprivate \\$q: ng.IQService,",
      "\t\tprivate \\$location: ng.ILocationService,",
      "\t\tprivate \\$routeParams: ng.route.IRouteParamsService,",
      "\t\tprivate dataService: see.IDataService,",
      "\t) {}\n",
      "\t\\$onInit(): void {",
      "\t\tthis.\\$q.all([]);",
      "\t}\n}\n",
      "export const ${1:Component}: ng.IComponentOptions = {",
      "\ttemplate: require('./$2.template.html'),",
      "\tcontroller: ${1:Component}Controller,",
      "};\n"
    ]
  },
  "AngularJS Module": {
    "prefix": "ngm",
    "description": "AngularJS module",
    "body": [
      "import * as angular from 'angular'$3",
      "\nexport default",
      "\tangular",
      "\t\t.module('${1:moduleName}', [$2])$0",
      "\t\t.name\n"
    ]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment