Last active
January 10, 2017 22:16
-
-
Save peabnuts123/1efc0823fa24a6ad0606 to your computer and use it in GitHub Desktop.
Visual Studio CodeSnippet for JavaScript. AngularJS factory definition
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> | |
</SnippetTypes> | |
<Title>Angular Factory</Title> | |
<Author>Jeff Andrews</Author> | |
<Description>Creates an angular factory with reference to a module</Description> | |
<HelpUrl> | |
</HelpUrl> | |
<Shortcut>ngfactory</Shortcut> | |
</Header> | |
<Snippet> | |
<Declarations> | |
<Literal Editable="true"> | |
<ID>factoryName</ID> | |
<ToolTip>Factory Name</ToolTip> | |
<Default>myFactory</Default> | |
<Function> | |
</Function> | |
</Literal> | |
<Literal Editable="true"> | |
<ID>moduleName</ID> | |
<ToolTip>Modulename</ToolTip> | |
<Default>myModule</Default> | |
<Function> | |
</Function> | |
</Literal> | |
</Declarations> | |
<Code Language="JavaScript"> | |
<![CDATA[(function $factoryName$(angular) { | |
var module = angular.module('$moduleName$'); | |
module.factory('$factoryName$', [$factoryName$Function]); | |
function $factoryName$Function() { | |
var $factoryName$ = {}; | |
return $factoryName$; | |
} | |
})(angular);]]></Code> | |
</Snippet> | |
</CodeSnippet> | |
</CodeSnippets> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment