Skip to content

Instantly share code, notes, and snippets.

@docluv
Created May 15, 2014 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save docluv/3b39dfb01a2c1d132941 to your computer and use it in GitHub Desktop.
Save docluv/3b39dfb01a2c1d132941 to your computer and use it in GitHub Desktop.
SPAView
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>SPA JavaScript View</Title>
<Author>Chris Love</Author>
<Description>Creates the Base Code for a SPA JavaScript View</Description>
<Shortcut>view</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>viewname</ID>
<ToolTip>View Name</ToolTip>
<Default>myview</Default>
</Literal>
<Literal>
<ID>appname</ID>
<ToolTip>App Name</ToolTip>
<Default>myApp</Default>
</Literal>
</Declarations>
<Code Language="JavaScript">
<![CDATA[
;
//Example SPA JavaScript View
//It is wrapped within an anymous enclosure
(function (window, undefined) {
"use strict";
$appName$.fn.$viewname$ = {
onload: function (params) {
var that = this;
that.lv = that.$viewname$;
},
unload: function () { },
lv: undefined
};
}(window));
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment