Last active
August 14, 2016 01:51
-
-
Save hellsan631/6eff8cbed7f7043b3b4f9542c4a633b4 to your computer and use it in GitHub Desktop.
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 characters
{ | |
"Print to console": { | |
"prefix": "log", | |
"description": "Log output to console", | |
"body": [ | |
"console.log('$1');", | |
"$2" | |
] | |
}, | |
"Create basic Promise": { | |
"prefix": "prom", | |
"description": "create new ES6/Bluebird Promise boilerplate", | |
"body": [ | |
"new Promise(function(resolve, reject) {", | |
" $1", | |
"});" | |
] | |
}, | |
"Promise Then": { | |
"prefix": "then", | |
"description": "create a then after a promise", | |
"body": [ | |
".then(function($1) {", | |
" $2", | |
"})" | |
] | |
}, | |
"Promise Catch": { | |
"prefix": "catc", | |
"description": "create a catch after a promise", | |
"body": [ | |
".catch(function(err) {", | |
" $1", | |
"})" | |
] | |
}, | |
"Prototype": { | |
"prefix": "proto", | |
"description": "creates prototype boilerplate", | |
"body": [ | |
"$1.prototype.${2} = function ${2:name}(){", | |
" $3", | |
"};" | |
] | |
}, | |
"Anonomous function": { | |
"prefix": "func", | |
"description": "creates prototype boilerplate", | |
"body": [ | |
"function($1) {", | |
" $2", | |
"}" | |
] | |
}, | |
"Angular 1 Component": { | |
"prefix": "ngd", | |
"description": "angular 1 directive component boilerplate", | |
"body": [ | |
";(function () {", | |
" 'use strict';", | |
"", | |
" angular", | |
" .module('$1')", | |
" .directive('$2', ${2:componentName});", | |
"", | |
" /* @ngInject */", | |
" function ${2:componentName}(multiline) {", | |
" var template = multiline(function() {/*", | |
"", | |
" */});", | |
"", | |
" var directive = {", | |
" restrict: 'E',", | |
" template: template,", | |
" scope: {},", | |
" bindToController: {", | |
" },", | |
" controller: Controller,", | |
" controllerAs: 'sm'", | |
" };", | |
"", | |
" return directive;", | |
" }", | |
"", | |
" /* @ngInject */", | |
" function Controller($state, Auth) {", | |
" var sm = this;", | |
"", | |
" }", | |
"})();" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment