Last active
September 22, 2016 20:02
-
-
Save DakotaLMartinez/d5ce20712ac5bc792ee3d1694427e3fc to your computer and use it in GitHub Desktop.
Visual Studio Code Snippet to create an Angular 1 Component
This file contains 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 characters
"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