Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sublime snippet for Dojo templated widget boilerplate
<snippet>
<content><![CDATA[
define([
'dijit/_TemplatedMixin',
'dijit/_WidgetBase',
'dojo/_base/declare',
${2:
'dojo/i18n!./$1/nls/resources',}
'dojo/text!./$1/templates/$1.html'${5:,
'xstyle/css!./$1/css/$1.css'}
], function(
_TemplatedMixin, _WidgetBase,
declare,
${3:nls, }template${6:,
stylesheet}
) {
return declare([_WidgetBase, _TemplatedMixin], {${7:
baseClass: '$1',}
templateString: template,
// Widget LifeCycle${8:
constructor: function() \{${4:
this.nls = declare.safeMixin(this.nls || \{\}, nls);}
$9
\},}${10:
postMixInProperties: function() \{
this.inherited(arguments);$11
\},}${12:
buildRendering: function() \{
this.inherited(arguments);$13
\},}${14:
postCreate: function() \{
this.inherited(arguments);$15
\},}${16:
startup: function() \{
this.inherited(arguments);$17
\},}${18:
destroy: function() \{
this.inherited(arguments);$19
\}}$20
});
});
]]></content>
<tabTrigger>define()</tabTrigger>
<scope>source.js</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.