Skip to content

Instantly share code, notes, and snippets.

@lennybacon
Last active August 29, 2015 14:17
Show Gist options
  • Save lennybacon/fc964bc32e9a98ff303f to your computer and use it in GitHub Desktop.
Save lennybacon/fc964bc32e9a98ff303f to your computer and use it in GitHub Desktop.
ng-http snippet for visual studio
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<!-- {MyDocuments}\Visual Studio 2013\Code Snippets\Visual Web Developer\My JScript Snippets\ng-http.snippet -->
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>Angular $http</Title>
<Author>Daniel Fisher</Author>
<Shortcut>nghttp</Shortcut>
</Header>
<Snippet>
<Code Language="JavaScript">
<![CDATA[$$http(
{
method: 'GET',
url: '/someUrl',
params: {'query_string_variable': 42},
data: {'form_variable': 42},
headers: { 'x-header': 42 },
cache: false,
timeout: 3000,
withCredentials: true
}
).
success(
function (data, status, headers, config) {
}
).
error(
function (data, status, headers, config) {
}
);]]>
</Code>
</Snippet>
</CodeSnippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment