Created
March 3, 2014 21:18
-
-
Save litzinger/9334805 to your computer and use it in GitHub Desktop.
Creates getter and setter in JavaScript model
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
/** | |
* Get $2 | |
* | |
* @return ${3:[type]} $2 | |
*/ | |
$1.prototye.get${1/(.*)/\u$2/} = function() | |
{ | |
return this.${2:$SELECTION}; | |
} | |
/** | |
* Set $2 | |
* | |
* @param ${3:[type]} $2 | |
* | |
* @return static | |
*/ | |
$1.prototype.set${1/(.*)/\u$2/} = function($4$2) | |
{ | |
this.$2 = $2; | |
return this; | |
} | |
]]></content> | |
<!-- Optional: Tab trigger to activate the snippet --> | |
<tabTrigger>getset-js</tabTrigger> | |
<!-- Optional: Scope the tab trigger will be active in --> | |
<scope>source.js</scope> | |
<!-- Optional: Description to show in the menu --> | |
<description>Create getter and setter methods</description> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment