Last active
September 19, 2016 22:46
-
-
Save DakotaLMartinez/1840f35d0c0cc6dc9f7d2465fb17ceea to your computer and use it in GitHub Desktop.
Visual Studio Code Snippet for Angular 1 Custom Filter
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
"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