Skip to content

Instantly share code, notes, and snippets.

@DakotaLMartinez
Last active September 19, 2016 22:46
Show Gist options
  • Save DakotaLMartinez/1840f35d0c0cc6dc9f7d2465fb17ceea to your computer and use it in GitHub Desktop.
Save DakotaLMartinez/1840f35d0c0cc6dc9f7d2465fb17ceea to your computer and use it in GitHub Desktop.
Visual Studio Code Snippet for Angular 1 Custom Filter
"Angular Filter": {
"prefix": "ng1filter",
"body": [
"angular",
"\t.module('app')",
"\t.filter('${filterName}', ${filterName});",
"\t",
"\tfunction ${filterName}() {",
"\t\treturn function(input) {",
"\t\t\tif (${formatCondition}) {",
"\t\t\t\t$0",
"\t\t\t} else {",
"\t\t\t\tthrow new Error('${filterName}Filter must be given ${formatType}');",
"\t\t\t}",
"\t\t};",
"\t};"
],
"description": "Angular 1 Filter"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment