Here is snippet for revealing modul template explained among other here:
https://addyosmani.com/resources/essentialjsdesignpatterns/book/#revealingmodulepatternjavascript
For some reason only way to register is to create custom folder and use "Add" instead of "Import".
Bad part is that it doesn't get copied but just keeps reference to your folder.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>JS revealing module pattern</Title>
<Shortcut>jsmodule</Shortcut>
</Header>
<Snippet>
<Declarations>
<Object>
<ID>Namespace</ID>
<Type>object</Type>
<ToolTip>Namespace</ToolTip>
<Default>Namespace</Default>
</Object>
</Declarations>
<Code Language="CSharp">
<![CDATA[
"use strict";
var Snt = Snt || {};
Snt.$Namespace$ = Snt.$Namespace$ || {};
Snt.$Namespace$.ViewManager = (function () {
var options = null;
function init(optionsParam) {
if (optionsParam) {
$$.extend(options, optionsParam);
}
}
return {
Init : init
};
})();
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
No comments:
Post a Comment