Created
May 15, 2014 12:24
-
-
Save docluv/3b39dfb01a2c1d132941 to your computer and use it in GitHub Desktop.
SPAView
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> | |
<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